fix hugegraph-hbase and hugegraph-example checkstyle issue by mayelena · Pull Request #1864 · apache/hugegraph

@mayelena

@mayelena mayelena changed the title fix hugegraph-hbase checkstyle issue fix hugegraph-hbase and hugegraph-example checkstyle issue

May 7, 2022

javeme


protected void parseRowColumns(Result row, BackendEntry entry, Query query, boolean enablePartition)
protected void parseRowColumns(Result row, BackendEntry entry, Query query,
boolean enablePartition)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

align with "Result"

private static final Logger LOG = Log.logger(HbaseStore.class);

private final BackendFeatures FEATURES;
private final BackendFeatures features;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also update references

import com.google.common.util.concurrent.Futures;

public class HbaseSessions extends BackendSessionPool {
private static final Logger LOG = Log.logger(HbaseSessions.class);

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

.build());
}
byte[][] splits = new byte[numOfPartitions - 1][org.apache.hadoop.hbase.util.Bytes.SIZEOF_SHORT];
byte[][] splits = new byte[numOfPartitions - 1][org.apache.hadoop

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"

@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",

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 {}",

byte[] key = CellUtil.cloneQualifier(cell);
byte[] val = CellUtil.cloneValue(cell);
System.out.println(String.format(" %s=%s",
LOG.info(String.format(" %s=%s",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrap line before config

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrap line before config

@mayelena

@mayelena

javeme

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 " +

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",

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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

javeme

.has("name", "Tom Hanks")
.outE("ACTED_IN").toList();
System.out.println(">>>> Tom Hanks ACTED_IN: " + tomhanksMovies);
LOG.info{(">>>> Tom Hanks ACTED_IN: {}", tomhanksMovies);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove "{"

@mayelena

@mayelena

javeme

f.addEdge("directedBy", l);

G.addEdge("directedBy", M);
G.addEdge("directedBy", m);

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

@mayelena

javeme

javeme previously approved these changes May 8, 2022

@codecov

imbajin

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?

Comment on lines 239 to 240

builder.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(cf)
.build());

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +242 to +243

byte[][] splits = new byte[numOfPartitions - 1]
[org.apache.hadoop.hbase.util.Bytes.SIZEOF_SHORT];

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

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

@mayelena

javeme

byte[] key = CellUtil.cloneQualifier(cell);
byte[] val = CellUtil.cloneValue(cell);
System.out.println(String.format(" %s=%s",
LOG.info(String.format(" {}={}",

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

@mayelena

javeme

imbajin