-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: format and clean code in modules #2439
Conversation
...aph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/cache/CacheManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of align could be merged into one line (manually), but it will cost some time
...h-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraMetrics.java
Show resolved
Hide resolved
...aph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraShard.java
Show resolved
Hide resolved
...aph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraStore.java
Show resolved
Hide resolved
protected String escapeAndWrapString(String value) { | ||
if (value.equals("\u0000")) { | ||
return "\'\'"; | ||
return "''"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better add a test or test it in local env first? (at least maybe add a PR comment here)
final StringBuilder builder = new StringBuilder("CypherClient{"); | ||
builder.append("userName='").append(userName).append('\'') | ||
.append(", token='").append(token).append('\'').append('}'); | ||
String builder = "CypherClient{" + "userName='" + userName + '\'' + | ||
", token='" + token + '\'' + '}'; | ||
|
||
return builder.toString(); | ||
return builder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore the clean for StringBuilder
(due to perf influence, check if we could config the rule to ignore it)
we could remove the unless SB transfer if we could ensure it's the call frequency is low
Context context = getContext(); | ||
if (context == null) { | ||
return null; | ||
} | ||
return context.user().toJson(); | ||
} | ||
|
||
protected static void logUser(User user, String path) { | ||
static void logUser(User user, String path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider keeping them first (modification should be separated & careful)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -49,7 +49,7 @@ services: | |||
networks: | |||
- ca-network | |||
healthcheck: | |||
test: ["CMD", "cqlsh", "--execute", "describe keyspaces;"] | |||
test: [ "CMD", "cqlsh", "--execute", "describe keyspaces;" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems better to config the yaml file rules to keep it as the origin style?
:remote connect tinkerpop.server conf/remote.yaml | ||
:> hugegraph | ||
: remote connect tinkerpop . server conf / remote.yaml | ||
: > hugegraph |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need ignore/exclude it
org.apache.hugegraph.plugin.HugeGraphGremlinPlugin: { }, | ||
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: { }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep original style
final double min15 = new BigDecimal(1.234567890987654321d) | ||
.setScale(15, BigDecimal.ROUND_DOWN) | ||
final double min15 = new BigDecimal("1.234567890987654321") | ||
.setScale(15, RoundingMode.DOWN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double & string number are the same case? need check it carefully
long splitSize = 1 * 1024 * 1024 - 1; | ||
long splitSize = 1024 * 1024 - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better keep it if we could config the rule (if we can't just remove it)
@@ -9140,7 +9141,7 @@ public void testEnhanceTextMatch() { | |||
Assert.assertEquals(1, vertices.size()); | |||
Assert.assertTrue(vertices.contains(vertex5)); | |||
|
|||
vertices = g.V().has("name", Text.contains("(秦始皇2|秦始皇3)")).toList(); | |||
vertices = g.V().has("name", Text.contains("(秦始皇 2|秦始皇 3)")).toList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be careful to change the space in code? (better just changed them in comment) to avoid risks
TODO: address the align space (now we use 8 instead 4?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the files were checked except for some clean rules that did not take effect (consider address them together in another PR )
Format & clean code in submodels: 1. API 2. Scylladb 3. Postgresql 4. Rocksdb 5. Palo 6. Mysql 7. Hbase 8. Cassandra 9. Test --------- Co-authored-by: imbajin <[email protected]>
Purpose of the PR
Main Changes
Format & clean code in submodels:
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODO
Doc - Done
Doc - No Need