-
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 hugegraph-hbase and hugegraph-example checkstyle issue #1864
Conversation
…into bugfix-branch
@@ -283,7 +283,8 @@ protected BackendEntryIterator newEntryIterator(Query query, | |||
}); | |||
} | |||
|
|||
protected void parseRowColumns(Result row, BackendEntry entry, Query query, boolean enablePartition) | |||
protected void parseRowColumns(Result row, BackendEntry entry, Query query, | |||
boolean enablePartition) |
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.
align with "Result"
@@ -54,7 +54,7 @@ public abstract class HbaseStore extends AbstractBackendStore<Session> { | |||
|
|||
private static final Logger LOG = Log.logger(HbaseStore.class); | |||
|
|||
private final BackendFeatures FEATURES; | |||
private final BackendFeatures features; |
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.
also update references
@@ -84,6 +86,7 @@ | |||
import com.google.common.util.concurrent.Futures; | |||
|
|||
public class HbaseSessions extends BackendSessionPool { | |||
private static final Logger LOG = Log.logger(HbaseSessions.class); |
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.
add a blank line after class define
TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder( | ||
TableName.valueOf(this.namespace, table)); | ||
for (byte[] cf : cfs) { | ||
builder.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(cf) | ||
.build()); | ||
} | ||
byte[][] splits = new byte[numOfPartitions - 1][org.apache.hadoop.hbase.util.Bytes.SIZEOF_SHORT]; | ||
byte[][] splits = new byte[numOfPartitions - 1][org.apache.hadoop |
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.
prefer to wrap line before "[org"
@@ -793,18 +798,18 @@ public long storeSize(String table) throws IOException { | |||
*/ | |||
@SuppressWarnings("unused") | |||
private void dump(String table, Scan scan) throws IOException { | |||
System.out.println(String.format(">>>> scan table %s with %s", | |||
LOG.info(String.format(">>>> scan table %s with %s", |
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.
LOG.info(">>>> scan table {} with {}",
CellScanner cellScanner = row.cellScanner(); | ||
while (cellScanner.advance()) { | ||
Cell cell = cellScanner.current(); | ||
byte[] key = CellUtil.cloneQualifier(cell); | ||
byte[] val = CellUtil.cloneValue(cell); | ||
System.out.println(String.format(" %s=%s", | ||
LOG.info(String.format(" %s=%s", |
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.
ditto
@@ -445,7 +447,8 @@ public static class HbaseSchemaStore extends HbaseStore { | |||
|
|||
public HbaseSchemaStore(HugeConfig config, BackendStoreProvider provider, | |||
String namespace, String store) { | |||
super(provider, namespace, store, config.get(HbaseOptions.HBASE_ENABLE_PARTITION).booleanValue()); | |||
super(provider, namespace, store, config.get(HbaseOptions |
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.
wrap line before config
@@ -492,7 +495,8 @@ public static class HbaseGraphStore extends HbaseStore { | |||
private boolean enablePartition; | |||
public HbaseGraphStore(HugeConfig config, BackendStoreProvider provider, | |||
String namespace, String store) { | |||
super(provider, namespace, store, config.get(HbaseOptions.HBASE_ENABLE_PARTITION).booleanValue()); | |||
super(provider, namespace, store, config.get(HbaseOptions.HBASE_ENABLE_PARTITION) |
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.
wrap line before config
@@ -30,7 +30,7 @@ public class ThreadRangePerfTest { | |||
|
|||
public static void main(String[] args) throws Exception { | |||
if (args.length != 6) { | |||
System.out.println("Usage: minThread maxThread threadStep " + | |||
LOG.info("Usage: minThread maxThread threadStep " + |
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.
update alignment of line 34
LOG.info("Insert rate with threads: {} vertices/s & {} edges/s, " + | ||
"insert total {} vertices & {} edges, cost time: {}ms", | ||
LOG.info("Insert rate with threads: {} vertices/s & {} edges/s, | ||
insert total {} vertices & {} edges, cost time: {}ms", |
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.
there is a syntax error here, please keep the origin code
LOG.info("Query rate with threads: {} vertices/s, " + | ||
"query total vertices {}, cost time: {}ms", | ||
LOG.info("Query rate with threads: {} vertices/s, | ||
query total vertices {}, cost time: {}ms", |
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.
ditto
|
||
// query edges by condition | ||
List<Edge> tomhanksMovies = graph.traversal().V() | ||
.hasLabel("person") | ||
.has("name", "Tom Hanks") | ||
.outE("ACTED_IN").toList(); | ||
System.out.println(">>>> Tom Hanks ACTED_IN: " + tomhanksMovies); | ||
LOG.info{(">>>> Tom Hanks ACTED_IN: {}", tomhanksMovies); |
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.
remove "{"
|
||
G.addEdge("directedBy", M); | ||
G.addEdge("directedBy", m); |
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.
Error: /home/runner/work/incubator-hugegraph/incubator-hugegraph/hugegraph-example/src/main/java/com/baidu/hugegraph/example/Example3.java:[122,9] cannot find symbol
symbol: variable G
location: class com.baidu.hugegraph.example.Example3
Codecov Report
@@ Coverage Diff @@
## master #1864 +/- ##
============================================
+ Coverage 66.96% 70.95% +3.99%
Complexity 980 980
============================================
Files 447 447
Lines 38045 38072 +27
Branches 5391 5401 +10
============================================
+ Hits 25477 27015 +1538
+ Misses 10065 8410 -1655
- Partials 2503 2647 +144
Continue to review full report at Codecov.
|
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.
@seagle-yuan if we don't divide these case, will it hit against the check-style?
builder.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(cf) | ||
.build()); |
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.
align or not to divide?
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.
No rules will be hit.
The below line is indented more than 4 blankspace.
And we setted forceStrictCondition = false, so more than 4 space is ok.
https://checkstyle.sourceforge.io/config_misc.html#Indentation.
there isn't any rules about align in all checkstyle rules
byte[][] splits = new byte[numOfPartitions - 1] | ||
[org.apache.hadoop.hbase.util.Bytes.SIZEOF_SHORT]; |
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 divide it makes a little strange for readable
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.
it rely on the setting of IDE
CellScanner cellScanner = row.cellScanner(); | ||
while (cellScanner.advance()) { | ||
Cell cell = cellScanner.current(); | ||
byte[] key = CellUtil.cloneQualifier(cell); | ||
byte[] val = CellUtil.cloneValue(cell); | ||
System.out.println(String.format(" %s=%s", | ||
LOG.info(String.format(" {}={}", |
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.
remove String.format and update alignment
No description provided.