Skip to content

Commit b9124a3

Browse files
checkstyle fixed
1 parent 44b1916 commit b9124a3

File tree

19 files changed

+32
-45
lines changed

19 files changed

+32
-45
lines changed

hugegraph-loader/src/main/java/org/apache/hugegraph/loader/HugeGraphLoader.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.util.concurrent.CompletableFuture;
3030
import java.util.concurrent.CompletionException;
3131
import java.util.concurrent.ExecutorService;
32-
import java.util.concurrent.ThreadPoolExecutor;
3332
import java.util.function.Supplier;
3433
import java.util.stream.Collectors;
3534
import java.util.stream.Stream;
@@ -76,10 +75,7 @@
7675
import org.apache.hugegraph.loader.source.SourceType;
7776
import org.apache.hugegraph.loader.source.graph.GraphSource;
7877
import org.apache.hugegraph.structure.constant.HugeType;
79-
import org.apache.hugegraph.structure.schema.EdgeLabel;
80-
import org.apache.hugegraph.structure.schema.IndexLabel;
8178
import org.apache.hugegraph.structure.schema.PropertyKey;
82-
import org.apache.hugegraph.structure.schema.VertexLabel;
8379
import org.apache.hugegraph.util.Log;
8480
import org.apache.hugegraph.util.JsonUtil;
8581

@@ -412,7 +408,7 @@ private void createGraphSourceVertexLabel(HugeClient sourceClient,
412408

413409
if (des.getProperties() != null) {
414410
des.getProperties()
415-
.forEach((p) -> vertexLabel.properties().remove(p));
411+
.forEach((p) -> vertexLabel.properties().remove(p));
416412
}
417413
}
418414

@@ -489,7 +485,7 @@ private void createGraphSourceEdgeLabel(HugeClient sourceClient,
489485

490486
if (des.getProperties() != null) {
491487
des.getProperties()
492-
.forEach((p) -> edgeLabel.properties().remove(p));
488+
.forEach((p) -> edgeLabel.properties().remove(p));
493489
}
494490
}
495491

hugegraph-loader/src/main/java/org/apache/hugegraph/loader/MappingConverter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.nio.file.Paths;
2222

2323
import org.apache.commons.io.FileUtils;
24-
import org.apache.hugegraph.loader.util.JsonUtil;
2524
import org.apache.hugegraph.loader.util.MappingUtil;
2625
import org.slf4j.Logger;
2726

hugegraph-loader/src/main/java/org/apache/hugegraph/loader/builder/EdgeBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public EdgeBuilder(LoadContext context, InputStruct struct,
6363
this.targetLabel = new VertexLabel("~general");
6464
this.sourceLabel.idStrategy(IdStrategy.CUSTOMIZE_STRING);
6565
this.targetLabel.idStrategy(IdStrategy.CUSTOMIZE_STRING);
66-
}else {
66+
} else {
6767
this.sourceLabel = this.getVertexLabel(this.edgeLabel.sourceLabel());
6868
this.targetLabel = this.getVertexLabel(this.edgeLabel.targetLabel());
6969
}

hugegraph-loader/src/main/java/org/apache/hugegraph/loader/builder/NopEdgeBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.apache.hugegraph.structure.graph.Edge;
2929
import org.apache.hugegraph.structure.schema.SchemaLabel;
3030

31-
public class NopEdgeBuilder extends ElementBuilder<Edge>{
31+
public class NopEdgeBuilder extends ElementBuilder<Edge> {
3232

3333
public NopEdgeBuilder(LoadContext context, InputStruct struct) {
3434
super(context, struct);

hugegraph-loader/src/main/java/org/apache/hugegraph/loader/builder/NopVertexBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.apache.hugegraph.structure.schema.SchemaLabel;
3030
import org.apache.hugegraph.structure.schema.VertexLabel;
3131

32-
public class NopVertexBuilder extends ElementBuilder<Vertex>{
32+
public class NopVertexBuilder extends ElementBuilder<Vertex> {
3333

3434
public NopVertexBuilder(LoadContext context, InputStruct struct) {
3535
super(context, struct);

hugegraph-loader/src/main/java/org/apache/hugegraph/loader/executor/LoadContext.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.apache.hugegraph.loader.executor;
1919

2020
import java.io.IOException;
21-
import java.io.Serializable;
2221
import java.util.Map;
2322
import java.util.concurrent.ConcurrentHashMap;
2423

hugegraph-loader/src/main/java/org/apache/hugegraph/loader/executor/LoadOptions.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public final class LoadOptions implements Cloneable {
8989

9090
@Parameter(names = {"-g", "--graph"},
9191
arity = 1,
92-
description = "The name of the graph to load into, if not specified, hugegraph will be used")
92+
description = "The name of the graph to load into, " +
93+
"if not specified, hugegraph will be used")
9394
public String graph = "hugegraph";
9495

9596
@Parameter(names = {"--create-graph"}, required = false, arity = 1,
@@ -176,7 +177,7 @@ public final class LoadOptions implements Cloneable {
176177
description = "The number of lines in each submit")
177178
public int batchSize = 500;
178179

179-
@Parameter(names = {"--parallel-count"}, arity = 1,
180+
@Parameter(names = {"--parallel-count"}, arity = 1,
180181
description = "The number of parallel read pipelines")
181182
public int parallelCount = 1;
182183

@@ -260,7 +261,8 @@ public final class LoadOptions implements Cloneable {
260261
description = "Whether the hugegraph-loader work in test mode")
261262
public boolean testMode = false;
262263

263-
@Parameter(names = {"-help", "--help"}, help = true, description = "Print usage of HugeGraphLoader")
264+
@Parameter(names = {"-help", "--help"}, help = true, description =
265+
"Print usage of HugeGraphLoader")
264266
public boolean help;
265267

266268
@Parameter(names = {"--use-prefilter"}, required = false, arity = 1,
@@ -395,8 +397,8 @@ public static LoadOptions parseOptions(String[] args) {
395397
return options;
396398
}
397399

398-
public ShortIdConfig getShortIdConfig(String vertexLabel){
399-
for(ShortIdConfig config: shorterIDConfigs) {
400+
public ShortIdConfig getShortIdConfig(String vertexLabel) {
401+
for (ShortIdConfig config: shorterIDConfigs) {
400402
if (config.getVertexLabel().equals(vertexLabel)) {
401403
return config;
402404
}

hugegraph-loader/src/main/java/org/apache/hugegraph/loader/failure/FailLogger.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import java.io.Reader;
3131
import java.io.Writer;
3232
import java.nio.charset.Charset;
33-
import java.nio.file.Files;
3433
import java.nio.file.Paths;
3534
import java.util.HashSet;
3635
import java.util.Set;
@@ -152,8 +151,8 @@ private void removeDupLines() {
152151
Set<Integer> writedLines = new HashSet<>();
153152
HashFunction hashFunc = Hashing.murmur3_32();
154153
for (String tipsLine, dataLine;
155-
(tipsLine = reader.readLine()) != null &&
156-
(dataLine = reader.readLine()) != null;) {
154+
(tipsLine = reader.readLine()) != null &&
155+
(dataLine = reader.readLine()) != null;) {
157156
/*
158157
* Hash data line to remove duplicate lines
159158
* Misjudgment may occur, but the probability is extremely low

hugegraph-loader/src/main/java/org/apache/hugegraph/loader/filter/ElementLimitFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public boolean parse(GraphElement element) {
5454
v.addAndGet(1);
5555
return v;
5656
});
57-
return counter.addAndGet(edge.sourceId()) <= limit
58-
&& counter.addAndGet(edge.targetId()) <= limit;
57+
return counter.addAndGet(edge.sourceId()) <= limit &&
58+
counter.addAndGet(edge.targetId()) <= limit;
5959
}
6060

6161
class LruCounter<K> {

hugegraph-loader/src/main/java/org/apache/hugegraph/loader/filter/ShortIdParser.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ public static byte[] stringToBytes(String str) {
144144

145145
public static byte[] longToBytes(long x) {
146146
return new byte[]{
147-
(byte) (x >>> 56),
148-
(byte) (x >>> 48),
149-
(byte) (x >>> 40),
150-
(byte) (x >>> 32),
151-
(byte) (x >>> 24),
152-
(byte) (x >>> 16),
153-
(byte) (x >>> 8),
154-
(byte) x};
147+
(byte) (x >>> 56),
148+
(byte) (x >>> 48),
149+
(byte) (x >>> 40),
150+
(byte) (x >>> 32),
151+
(byte) (x >>> 24),
152+
(byte) (x >>> 16),
153+
(byte) (x >>> 8),
154+
(byte) x};
155155
}
156156

157157
public static long bytesToLong(byte[] bytes) {

0 commit comments

Comments
 (0)