Skip to content

Commit 6dd52e4

Browse files
committed
fix(server): fix some issues of the distributed scheduler
1 parent f8fc58a commit 6dd52e4

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/ServerInfoManager.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@
1717

1818
package org.apache.hugegraph.task;
1919

20-
import com.google.common.collect.ImmutableMap;
20+
import static org.apache.hugegraph.backend.query.Query.NO_LIMIT;
21+
22+
import java.util.Iterator;
23+
import java.util.Map;
24+
import java.util.concurrent.Callable;
25+
import java.util.concurrent.ExecutorService;
26+
2127
import org.apache.hugegraph.HugeException;
2228
import org.apache.hugegraph.HugeGraph;
2329
import org.apache.hugegraph.HugeGraphParams;
@@ -42,12 +48,7 @@
4248
import org.apache.tinkerpop.gremlin.structure.Vertex;
4349
import org.slf4j.Logger;
4450

45-
import java.util.Iterator;
46-
import java.util.Map;
47-
import java.util.concurrent.Callable;
48-
import java.util.concurrent.ExecutorService;
49-
50-
import static org.apache.hugegraph.backend.query.Query.NO_LIMIT;
51+
import com.google.common.collect.ImmutableMap;
5152

5253
public class ServerInfoManager {
5354

@@ -114,7 +115,7 @@ public synchronized void initServerInfo(GlobalMasterInfo nodeInfo) {
114115
}
115116
}
116117
E.checkArgument(existed == null || !existed.alive(),
117-
"The server with name '%s' already in cluster", serverId);
118+
"The server with name '%s' already in cluster", serverId);
118119

119120
if (nodeInfo.nodeRole().master()) {
120121
String page = this.supportsPaging() ? PageInfo.PAGE_NONE : null;
@@ -123,8 +124,8 @@ public synchronized void initServerInfo(GlobalMasterInfo nodeInfo) {
123124
while (servers.hasNext()) {
124125
existed = servers.next();
125126
E.checkArgument(!existed.role().master() || !existed.alive(),
126-
"Already existed master '%s' in current cluster",
127-
existed.id());
127+
"Already existed master '%s' in current cluster",
128+
existed.id());
128129
}
129130
if (page != null) {
130131
page = PageInfo.pageInfo(servers);
@@ -231,7 +232,7 @@ private Id save(HugeServerInfo serverInfo) {
231232
HugeServerInfo.Schema schema = HugeServerInfo.schema(this.graph);
232233
if (!schema.existVertexLabel(HugeServerInfo.P.SERVER)) {
233234
throw new HugeException("Schema is missing for %s '%s'",
234-
HugeServerInfo.P.SERVER, serverInfo);
235+
HugeServerInfo.P.SERVER, serverInfo);
235236
}
236237
HugeVertex vertex = this.tx().constructVertex(false, serverInfo.asArray());
237238
// Add or update server info in backend store
@@ -250,7 +251,7 @@ private <V> V call(Callable<V> callable) {
250251
return this.dbExecutor.submit(callable).get();
251252
} catch (Throwable e) {
252253
throw new HugeException("Failed to update/query server info: %s",
253-
e, e.toString());
254+
e, e.toString());
254255
}
255256
}
256257

0 commit comments

Comments
 (0)