fix: format and clean code in modules#2439
Conversation
...aph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/cache/CacheManager.java
Show resolved
Hide resolved
imbajin
left a comment
There was a problem hiding this comment.
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.
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.
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
| } | ||
|
|
||
| protected static void logUser(User user, String path) { | ||
| static void logUser(User user, String path) { |
There was a problem hiding this comment.
consider keeping them first (modification should be separated & careful)
| - ca-network | ||
| healthcheck: | ||
| test: ["CMD", "cqlsh", "--execute", "describe keyspaces;"] | ||
| test: [ "CMD", "cqlsh", "--execute", "describe keyspaces;" ] |
There was a problem hiding this comment.
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 |
| org.apache.hugegraph.plugin.HugeGraphGremlinPlugin: { }, | ||
| org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: { }, |
| 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.
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.
better keep it if we could config the rule (if we can't just remove it)
| 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.
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?)
imbajin
left a comment
There was a problem hiding this comment.
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 <jin@apache.org>

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 - TODODoc - DoneDoc - No Need