javeme commented on code in PR #209: URL: https://github.com/apache/incubator-hugegraph-computer/pull/209#discussion_r1033609910
########## computer-api/src/main/java/org/apache/hugegraph/computer/core/config/ComputerOptions.java: ########## @@ -137,7 +137,7 @@ public static synchronized ComputerOptions instance() { new ConfigOption<>( "input.filter_class", "The class to create input-filter object, " + - "input-filter is used to Filter vertex edges " + + "input-filter is used to Filter vertex edges " + Review Comment: can we keep the origin style ########## computer-api/src/main/java/org/apache/hugegraph/computer/core/aggregator/Aggregator4Master.java: ########## @@ -38,15 +38,15 @@ public interface Aggregator4Master { * Used by algorithm's master-computation init() to register aggregators. */ <V extends Value, C extends Aggregator<V>> - void registerAggregator(String name, Class<C> aggregator); + void registerAggregator(String name, Class<C> aggregator); Review Comment: can we keep the origin style ########## computer-core/src/main/java/org/apache/hugegraph/computer/core/input/loader/FileElementFetcher.java: ########## @@ -59,9 +59,9 @@ public FileElementFetcher(Config config) { ComputerOptions.INPUT_LOADER_SCHEMA_PATH); SchemaCache schemaCache; try { - String json = FileUtils.readFileToString(new File(schemaPath), + String json = FileUtils.readFileToString(new File(schemaPath), Review Comment: also update line 63 ########## computer-core/src/main/java/org/apache/hugegraph/computer/core/bsp/EtcdClient.java: ########## @@ -126,8 +125,7 @@ public byte[] get(String key, boolean throwException) { assert kvs.size() == 1; return kvs.get(0).getValue().getBytes(); } else if (throwException) { - throw new ComputerException("Can't find value for key='%s'", - key); + throw new ComputerException("Can't find value for key='%s'",key); Review Comment: expect a space after ',' and can we also auto check it ########## computer-api/src/main/java/org/apache/hugegraph/computer/core/output/hg/task/InsertTask.java: ########## @@ -37,10 +37,10 @@ public abstract class InsertTask implements Runnable { ); public static final String[] UNACCEPTABLE_MESSAGES = { - // org.apache.http.conn.HttpHostConnectException - "Connection refused", - "The server is being shutting down", - "not allowed to insert, because already exist a vertex " + + // org.apache.http.conn.HttpHostConnectException Review Comment: can we keep the origin style ########## computer-core/src/main/java/org/apache/hugegraph/computer/core/master/MasterService.java: ########## @@ -131,6 +131,7 @@ private void stopServiceThread() { try { this.serviceThread.interrupt(); } catch (Throwable ignore) { + LOG.error("stop stopServiceThread exception"); Review Comment: prefer `LOG.warn("Exception when serviceThread.interrupt()", e);` ########## computer-core/src/main/java/org/apache/hugegraph/computer/core/common/ContainerInfo.java: ########## @@ -85,11 +85,11 @@ public int dataPort() { } public String uniqueName() { - StringBuilder sb = new StringBuilder(); - sb.append(this.hostname) - .append(":") - .append(this.dataPort); - return sb.toString(); + StringBuilder stbu = new StringBuilder(); Review Comment: prefer `builder` name ########## computer-core/src/main/java/org/apache/hugegraph/computer/core/network/netty/AbstractNettyHandler.java: ########## @@ -108,7 +109,7 @@ protected void processPingMessage(ChannelHandlerContext ctx, Channel channel, PingMessage pingMessage) { ctx.writeAndFlush(PongMessage.INSTANCE) - .addListener(ChannelFutureListener.CLOSE_ON_FAILURE); + .addListener(ChannelFutureListener.CLOSE_ON_FAILURE); Review Comment: rename to context? ########## computer-core/src/main/java/org/apache/hugegraph/computer/core/network/netty/HeartbeatHandler.java: ########## @@ -79,7 +79,7 @@ public void userEventTriggered(final ChannelHandlerContext ctx, } ctx.writeAndFlush(PingMessage.INSTANCE) - .addListener(ChannelFutureListener.CLOSE_ON_FAILURE); + .addListener(ChannelFutureListener.CLOSE_ON_FAILURE); Review Comment: rename to context? ########## computer-core/src/main/java/org/apache/hugegraph/computer/core/master/MasterService.java: ########## @@ -388,7 +389,7 @@ public DefaultMasterContext() { @Override public <V extends Value, C extends Aggregator<V>> - void registerAggregator(String name, Class<C> aggregatorClass) { + void registerAggregator(String name, Class<C> aggregatorClass) { Review Comment: ditto ########## computer-test/src/main/java/org/apache/hugegraph/computer/core/config/DefaultConfigTest.java: ########## @@ -94,7 +94,7 @@ public void testGetLong() { config.getLong(KEY_EMPTY, defaultValue)); Assert.assertThrows(ComputerException.class, () -> { config.getLong(KEY_ABC, defaultValue); - } ,e -> { + },e -> { Review Comment: expect a space after ',' ########## computer-k8s-operator/src/main/java/org/apache/hugegraph/computer/k8s/operator/common/AbstractController.java: ########## @@ -421,11 +421,11 @@ private boolean hasSynced() { Duration.ofMillis(internal), Duration.ofMillis(timeout), () -> { - return this.informerMap - .values().stream() - .allMatch(SharedInformer::hasSynced); - }, - this.executor); + return this.informerMap + .values().stream() + .allMatch(SharedInformer::hasSynced); + }, Review Comment: prefer the origin style ########## computer-test/src/main/java/org/apache/hugegraph/computer/core/config/DefaultConfigTest.java: ########## @@ -74,7 +74,7 @@ public void testGetInt() { config.getInt(KEY_EMPTY, defaultValue)); Assert.assertThrows(ComputerException.class, () -> { config.getInt(KEY_ABC, defaultValue); - } ,e -> { + },e -> { Review Comment: expect a space after ',' ########## computer-core/src/main/java/org/apache/hugegraph/computer/core/network/TransportUtil.java: ########## @@ -102,21 +101,21 @@ public static List<String> getLocalIPAddress() { List<String> ips = new ArrayList<>(); try { Enumeration<NetworkInterface> allNetInterfaces = - NetworkInterface.getNetworkInterfaces(); + NetworkInterface.getNetworkInterfaces(); InetAddress ip; while (allNetInterfaces.hasMoreElements()) { NetworkInterface netInterface = allNetInterfaces.nextElement(); if (!netInterface.isLoopback() && !netInterface.isVirtual() && netInterface.isUp()) { - Enumeration<InetAddress> addresses = - netInterface.getInetAddresses(); - while (addresses.hasMoreElements()) { - ip = addresses.nextElement(); - if (ip instanceof Inet4Address) { - ips.add(ip.getHostAddress()); - } + Enumeration<InetAddress> addresses = + netInterface.getInetAddresses(); Review Comment: can keep single line? ########## computer-test/src/main/java/org/apache/hugegraph/computer/core/network/connection/ConnectionManagerTest.java: ########## @@ -74,9 +74,9 @@ public void testGetServerWithNoStart() { ConnectionManager connectionManager1 = new TransportConnectionManager(); Assert.assertThrows(IllegalArgumentException.class, connectionManager1::getServer, e -> { - Assert.assertContains("has not been initialized yet", + Assert.assertContains("has not been initialized yet", e.getMessage()); - }); + }); Review Comment: prefer the origin style ########## computer-test/src/main/java/org/apache/hugegraph/computer/core/config/DefaultConfigTest.java: ########## @@ -118,7 +118,7 @@ public void testGetDouble() throws IOException { delta); Assert.assertThrows(ComputerException.class, () -> { config.getDouble(KEY_ABC, defaultValue); - } ,e -> { + },e -> { Review Comment: expect a space after ',' -- 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-unsubscr...@hugegraph.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org