You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by GitBox <gi...@apache.org> on 2022/04/24 15:29:43 UTC

[GitHub] [incubator-hugegraph] z7658329 opened a new pull request, #1847: fix rocksdb&scylladb code checkstyle

z7658329 opened a new pull request, #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847

   fix rocksdb&scylladb code checkstyle


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] javeme commented on a diff in pull request #1847: fix rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
javeme commented on code in PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#discussion_r857282776


##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBTables.java:
##########
@@ -281,13 +281,13 @@ protected BackendColumnIterator queryByCond(Session session,
                         prefix = (Id) r.value();
                         break;
                     case GTE:
-                        minEq = true;
                     case GT:
+                        minEq = true;
                         min = (Id) r.value();
                         break;
                     case LTE:
-                        maxEq = true;
                     case LT:
+                        maxEq = true;

Review Comment:
   changed the code logic



##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBTables.java:
##########
@@ -281,13 +281,13 @@ protected BackendColumnIterator queryByCond(Session session,
                         prefix = (Id) r.value();
                         break;
                     case GTE:
-                        minEq = true;
                     case GT:
+                        minEq = true;

Review Comment:
   changed the code logic



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] javeme merged pull request #1847: fix cassandra&rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
javeme merged PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] z7658329 commented on a diff in pull request #1847: fix cassandra&rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
z7658329 commented on code in PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#discussion_r865594000


##########
hugegraph-scylladb/src/main/java/com/baidu/hugegraph/backend/store/scylladb/ScyllaDBTablesWithMV.java:
##########
@@ -230,24 +230,24 @@ protected void dropTable(CassandraSessionPool.Session session) {
         protected List<Select> query2Select(String table, Query query) {
             if (isQueryByLabel(query)) {
                 // Query from materialized view
-                return super.query2Select(MV_LABEL2VERTEX, query);
+                return super.query2Select(mvLabel2Vertex, query);
             }
             return super.query2Select(table, query);
         }
     }
 
     public static class Edge extends CassandraTables.Edge {
 
-        private final String MV_LABEL2EDGE = mvLabelTable(this.table());
+        private final String mvLabel2Edge = mvLabelTable(this.table());
 
-        private final String LABEL = CassandraTable.formatKey(HugeKeys.LABEL);
-        private final List<String> KEYS = this.idColumnName().stream()
+        private static final String LABEL = CassandraTable.formatKey(HugeKeys.LABEL);

Review Comment:
   定义静态变量编译会报错,无法访问成员变量



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] codecov[bot] commented on pull request #1847: fix rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#issuecomment-1107865325

   # [Codecov](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1847](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d8038a9) into [master](https://codecov.io/gh/apache/incubator-hugegraph/commit/9a8259ef3f22abf9781513b823a9f1096152d494?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9a8259e) will **decrease** coverage by `16.47%`.
   > The diff coverage is `5.45%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             master    #1847       +/-   ##
   =============================================
   - Coverage     66.93%   50.46%   -16.48%     
   - Complexity      444      659      +215     
   =============================================
     Files           446      446               
     Lines         37966    37967        +1     
     Branches       5410     5410               
   =============================================
   - Hits          25413    19159     -6254     
   - Misses         9957    16521     +6564     
   + Partials       2596     2287      -309     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../backend/store/cassandra/CassandraSessionPool.java](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVnZWdyYXBoLWNhc3NhbmRyYS9zcmMvbWFpbi9qYXZhL2NvbS9iYWlkdS9odWdlZ3JhcGgvYmFja2VuZC9zdG9yZS9jYXNzYW5kcmEvQ2Fzc2FuZHJhU2Vzc2lvblBvb2wuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...egraph/backend/store/cassandra/CassandraShard.java](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVnZWdyYXBoLWNhc3NhbmRyYS9zcmMvbWFpbi9qYXZhL2NvbS9iYWlkdS9odWdlZ3JhcGgvYmFja2VuZC9zdG9yZS9jYXNzYW5kcmEvQ2Fzc2FuZHJhU2hhcmQuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...egraph/backend/store/cassandra/CassandraStore.java](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVnZWdyYXBoLWNhc3NhbmRyYS9zcmMvbWFpbi9qYXZhL2NvbS9iYWlkdS9odWdlZ3JhcGgvYmFja2VuZC9zdG9yZS9jYXNzYW5kcmEvQ2Fzc2FuZHJhU3RvcmUuamF2YQ==) | `0.00% <0.00%> (-5.99%)` | :arrow_down: |
   | [...egraph/backend/store/cassandra/CassandraTable.java](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVnZWdyYXBoLWNhc3NhbmRyYS9zcmMvbWFpbi9qYXZhL2NvbS9iYWlkdS9odWdlZ3JhcGgvYmFja2VuZC9zdG9yZS9jYXNzYW5kcmEvQ2Fzc2FuZHJhVGFibGUuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...ugegraph/backend/store/rocksdb/RocksDBMetrics.java](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVnZWdyYXBoLXJvY2tzZGIvc3JjL21haW4vamF2YS9jb20vYmFpZHUvaHVnZWdyYXBoL2JhY2tlbmQvc3RvcmUvcm9ja3NkYi9Sb2Nrc0RCTWV0cmljcy5qYXZh) | `0.00% <0.00%> (-85.87%)` | :arrow_down: |
   | [...ugegraph/backend/store/rocksdb/RocksDBOptions.java](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVnZWdyYXBoLXJvY2tzZGIvc3JjL21haW4vamF2YS9jb20vYmFpZHUvaHVnZWdyYXBoL2JhY2tlbmQvc3RvcmUvcm9ja3NkYi9Sb2Nrc0RCT3B0aW9ucy5qYXZh) | `99.25% <ø> (ø)` | |
   | [...raph/backend/store/rocksdb/RocksDBStdSessions.java](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVnZWdyYXBoLXJvY2tzZGIvc3JjL21haW4vamF2YS9jb20vYmFpZHUvaHVnZWdyYXBoL2JhY2tlbmQvc3RvcmUvcm9ja3NkYi9Sb2Nrc0RCU3RkU2Vzc2lvbnMuamF2YQ==) | `44.85% <0.00%> (-31.97%)` | :arrow_down: |
   | [...h/backend/store/scylladb/ScyllaDBTablesWithMV.java](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVnZWdyYXBoLXNjeWxsYWRiL3NyYy9tYWluL2phdmEvY29tL2JhaWR1L2h1Z2VncmFwaC9iYWNrZW5kL3N0b3JlL3NjeWxsYWRiL1NjeWxsYURCVGFibGVzV2l0aE1WLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...hugegraph/backend/store/rocksdb/RocksDBTables.java](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVnZWdyYXBoLXJvY2tzZGIvc3JjL21haW4vamF2YS9jb20vYmFpZHUvaHVnZWdyYXBoL2JhY2tlbmQvc3RvcmUvcm9ja3NkYi9Sb2Nrc0RCVGFibGVzLmphdmE=) | `61.25% <50.00%> (-15.63%)` | :arrow_down: |
   | [...gegraph/backend/store/rocksdb/RocksDBSessions.java](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVnZWdyYXBoLXJvY2tzZGIvc3JjL21haW4vamF2YS9jb20vYmFpZHUvaHVnZWdyYXBoL2JhY2tlbmQvc3RvcmUvcm9ja3NkYi9Sb2Nrc0RCU2Vzc2lvbnMuamF2YQ==) | `80.00% <100.00%> (-20.00%)` | :arrow_down: |
   | ... and [198 more](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9a8259e...d8038a9](https://codecov.io/gh/apache/incubator-hugegraph/pull/1847?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] seagle-yuan commented on a diff in pull request #1847: fix cassandra&rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
seagle-yuan commented on code in PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#discussion_r863654886


##########
hugegraph-scylladb/src/main/java/com/baidu/hugegraph/backend/store/scylladb/ScyllaDBTablesWithMV.java:
##########
@@ -230,24 +230,24 @@ protected void dropTable(CassandraSessionPool.Session session) {
         protected List<Select> query2Select(String table, Query query) {
             if (isQueryByLabel(query)) {
                 // Query from materialized view
-                return super.query2Select(MV_LABEL2VERTEX, query);
+                return super.query2Select(mvLabel2Vertex, query);
             }
             return super.query2Select(table, query);
         }
     }
 
     public static class Edge extends CassandraTables.Edge {
 
-        private final String MV_LABEL2EDGE = mvLabelTable(this.table());
+        private final String mvLabel2Edge = mvLabelTable(this.table());
 
-        private final String LABEL = CassandraTable.formatKey(HugeKeys.LABEL);
-        private final List<String> KEYS = this.idColumnName().stream()
+        private static final String LABEL = CassandraTable.formatKey(HugeKeys.LABEL);

Review Comment:
   need static?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] seagle-yuan commented on a diff in pull request #1847: fix cassandra&rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
seagle-yuan commented on code in PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#discussion_r858770778


##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStdSessions.java:
##########
@@ -1058,14 +1059,14 @@ private boolean match(int expected) {
         @SuppressWarnings("unused")
         private void dump() {
             this.seek();
-            System.out.println(">>>> scan from " + this.table + ": "  +
-                               (this.keyBegin == null ? "*" :
-                                StringEncoding.format(this.keyBegin)) +
-                               (this.iter.isValid() ? "" : " - No data"));
+            LOG.info(">>>> scan from " + this.table + ": "  +
+                    (this.keyBegin == null ? "*" :
+                            StringEncoding.format(this.keyBegin)) +
+                    (this.iter.isValid() ? "" : " - No data"));
             for (; this.iter.isValid(); this.iter.next()) {
-                System.out.println(String.format("%s=%s",
-                                   StringEncoding.format(this.iter.key()),
-                                   StringEncoding.format(this.iter.value())));
+                LOG.info(String.format("%s=%s",

Review Comment:
   I thind we need remove "String.format"
   
   such as 
   
   https://github.com/apache/incubator-hugegraph/pull/1838#discussion_r855050621



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] seagle-yuan commented on a diff in pull request #1847: fix cassandra&rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
seagle-yuan commented on code in PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#discussion_r858770778


##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStdSessions.java:
##########
@@ -1058,14 +1059,14 @@ private boolean match(int expected) {
         @SuppressWarnings("unused")
         private void dump() {
             this.seek();
-            System.out.println(">>>> scan from " + this.table + ": "  +
-                               (this.keyBegin == null ? "*" :
-                                StringEncoding.format(this.keyBegin)) +
-                               (this.iter.isValid() ? "" : " - No data"));
+            LOG.info(">>>> scan from " + this.table + ": "  +
+                    (this.keyBegin == null ? "*" :
+                            StringEncoding.format(this.keyBegin)) +
+                    (this.iter.isValid() ? "" : " - No data"));
             for (; this.iter.isValid(); this.iter.next()) {
-                System.out.println(String.format("%s=%s",
-                                   StringEncoding.format(this.iter.key()),
-                                   StringEncoding.format(this.iter.value())));
+                LOG.info(String.format("%s=%s",

Review Comment:
   Would you remove "String.format"
   
   such as 
   
   https://github.com/apache/incubator-hugegraph/pull/1838#discussion_r855050621



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] javeme commented on a diff in pull request #1847: fix cassandra&rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
javeme commented on code in PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#discussion_r867429590


##########
hugegraph-scylladb/src/main/java/com/baidu/hugegraph/backend/store/scylladb/ScyllaDBTablesWithMV.java:
##########
@@ -263,15 +263,15 @@ protected void createIndex(CassandraSessionPool.Session session,
                          "  SELECT * FROM %s " +
                          "  WHERE %s IS NOT NULL AND %s IS NOT NULL " +
                          "  PRIMARY KEY(%s, %s)",
-                         MV_LABEL2EDGE, this.table(),
-                         this.LABEL, this.PRKEYS_NN,
-                         this.LABEL, this.PRKEYS);
+                    mvLabel2Edge, this.table(),

Review Comment:
   align with` "`



##########
hugegraph-cassandra/src/main/java/com/baidu/hugegraph/backend/store/cassandra/CassandraTable.java:
##########
@@ -107,12 +107,12 @@ public Number queryNumber(CassandraSessionPool.Session session,
             statement.setReadTimeoutMillis(timeout * 1000);
             return session.query(statement);
         }, (q, rs) -> {
-            Row row = rs.one();
-            if (row == null) {
-                return IteratorUtils.of(aggregate.defaultValue());
-            }
-            return IteratorUtils.of(row.getLong(0));
-        });
+                Row row = rs.one();

Review Comment:
   according to the latest conclusion, we can keep the original style lambda alignment



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] javeme commented on a diff in pull request #1847: fix cassandra&rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
javeme commented on code in PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#discussion_r861738515


##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStdSessions.java:
##########
@@ -1058,14 +1059,14 @@ private boolean match(int expected) {
         @SuppressWarnings("unused")
         private void dump() {
             this.seek();
-            System.out.println(">>>> scan from " + this.table + ": "  +
-                               (this.keyBegin == null ? "*" :
-                                StringEncoding.format(this.keyBegin)) +
-                               (this.iter.isValid() ? "" : " - No data"));
+            LOG.info(">>>> scan from {}: {}{}", 
+                    this.table,
+                    this.keyBegin == null ? "*" : StringEncoding.format(this.keyBegin),
+                    this.iter.isValid() ? "" : " - No data"));

Review Comment:
   `" - No data"))` => `" - No data")`
   there is an error: `/home/runner/work/incubator-hugegraph/incubator-hugegraph/hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStdSessions.java:1065:61: expecting RCURLY, found ')' -> [Help 1]`



##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStdSessions.java:
##########
@@ -1058,14 +1059,14 @@ private boolean match(int expected) {
         @SuppressWarnings("unused")
         private void dump() {
             this.seek();
-            System.out.println(">>>> scan from " + this.table + ": "  +
-                               (this.keyBegin == null ? "*" :
-                                StringEncoding.format(this.keyBegin)) +
-                               (this.iter.isValid() ? "" : " - No data"));
+            LOG.info(">>>> scan from {}: {}{}", 
+                    this.table,

Review Comment:
   align with `">>>>`?
   code style: https://github.com/apache/incubator-hugegraph-doc/wiki/HugeGraph%E4%BB%A3%E7%A0%81%E9%A3%8E%E6%A0%BC%E6%8C%87%E5%8D%97



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] javeme commented on a diff in pull request #1847: fix cassandra&rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
javeme commented on code in PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#discussion_r859572091


##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBOptions.java:
##########
@@ -168,7 +168,8 @@ public static synchronized RocksDBOptions instance() {
     public static final ConfigOption<Integer> MAX_BG_JOBS =
             new ConfigOption<>(
                     "rocksdb.max_background_jobs",
-                    "Maximum number of concurrent background jobs, including flushes and compactions.",
+                    "Maximum number of concurrent background jobs," +
+                            " including flushes and compactions.",

Review Comment:
   align with "Maximum..." and prefer to put the leading space in the previous line



##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStdSessions.java:
##########
@@ -1058,14 +1059,14 @@ private boolean match(int expected) {
         @SuppressWarnings("unused")
         private void dump() {
             this.seek();
-            System.out.println(">>>> scan from " + this.table + ": "  +
-                               (this.keyBegin == null ? "*" :
-                                StringEncoding.format(this.keyBegin)) +
-                               (this.iter.isValid() ? "" : " - No data"));
+            LOG.info(">>>> scan from " + this.table + ": "  +

Review Comment:
   prefer to use log format '{}'



##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStdSessions.java:
##########
@@ -1058,14 +1059,14 @@ private boolean match(int expected) {
         @SuppressWarnings("unused")
         private void dump() {
             this.seek();
-            System.out.println(">>>> scan from " + this.table + ": "  +
-                               (this.keyBegin == null ? "*" :
-                                StringEncoding.format(this.keyBegin)) +
-                               (this.iter.isValid() ? "" : " - No data"));
+            LOG.info(">>>> scan from " + this.table + ": "  +
+                    (this.keyBegin == null ? "*" :
+                            StringEncoding.format(this.keyBegin)) +
+                    (this.iter.isValid() ? "" : " - No data"));
             for (; this.iter.isValid(); this.iter.next()) {
-                System.out.println(String.format("%s=%s",
-                                   StringEncoding.format(this.iter.key()),
-                                   StringEncoding.format(this.iter.value())));
+                LOG.info(StringEncoding.format(this.iter.key()) +

Review Comment:
   since we can use log format '{}', and don't need string format anymore



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] javeme commented on a diff in pull request #1847: fix cassandra&rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
javeme commented on code in PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#discussion_r861443300


##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStdSessions.java:
##########
@@ -1059,13 +1059,12 @@ private boolean match(int expected) {
         @SuppressWarnings("unused")
         private void dump() {
             this.seek();
-            LOG.info(">>>> scan from " + this.table + ": "  +
+            LOG.info(">>>> scan from {}: {}{}", this.table,
                     (this.keyBegin == null ? "*" :
-                            StringEncoding.format(this.keyBegin)) +
+                            StringEncoding.format(this.keyBegin)),
                     (this.iter.isValid() ? "" : " - No data"));
             for (; this.iter.isValid(); this.iter.next()) {
-                LOG.info(StringEncoding.format(this.iter.key()) +
-                        "=" +
+                LOG.info("{}={}",StringEncoding.format(this.iter.key()),

Review Comment:
   ```java
   LOG.info("{}={}",
            StringEncoding.format(this.iter.key()),
            StringEncoding.format(this.iter.value()));
   ```



##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStdSessions.java:
##########
@@ -1059,13 +1059,12 @@ private boolean match(int expected) {
         @SuppressWarnings("unused")
         private void dump() {
             this.seek();
-            LOG.info(">>>> scan from " + this.table + ": "  +
+            LOG.info(">>>> scan from {}: {}{}", this.table,
                     (this.keyBegin == null ? "*" :
-                            StringEncoding.format(this.keyBegin)) +
+                            StringEncoding.format(this.keyBegin)),

Review Comment:
   ```java
   LOG.info(">>>> scan from {}: {}{}", 
            this.table,
            this.keyBegin == null ? "*" : StringEncoding.format(this.keyBegin),
            this.iter.isValid() ? "" : " - No data"));
   ```



##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBOptions.java:
##########
@@ -168,8 +168,8 @@ public static synchronized RocksDBOptions instance() {
     public static final ConfigOption<Integer> MAX_BG_JOBS =
             new ConfigOption<>(
                     "rocksdb.max_background_jobs",
-                    "Maximum number of concurrent background jobs," +
-                            " including flushes and compactions.",
+                    "Maximum number of concurrent background jobs, " +
+                          "including flushes and compactions.",

Review Comment:
   align with "Maximum number..."



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] z7658329 commented on a diff in pull request #1847: fix cassandra&rocksdb&scylladb code checkstyle

Posted by GitBox <gi...@apache.org>.
z7658329 commented on code in PR #1847:
URL: https://github.com/apache/incubator-hugegraph/pull/1847#discussion_r867426274


##########
hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBStdSessions.java:
##########
@@ -1058,14 +1059,14 @@ private boolean match(int expected) {
         @SuppressWarnings("unused")
         private void dump() {
             this.seek();
-            System.out.println(">>>> scan from " + this.table + ": "  +
-                               (this.keyBegin == null ? "*" :
-                                StringEncoding.format(this.keyBegin)) +
-                               (this.iter.isValid() ? "" : " - No data"));
+            LOG.info(">>>> scan from {}: {}{}", 
+                    this.table,

Review Comment:
   <img width="1066" alt="image" src="https://user-images.githubusercontent.com/5474723/167279532-5db5e0fe-d957-4af3-85df-9861181de241.png">
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org