-
Notifications
You must be signed in to change notification settings - Fork 93
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
refact: fix some code style with check plugin #385
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,6 @@ | |
|
||
SchemaManager schema = client.schema(); | ||
|
||
|
||
schema.propertyKey("name").asText().ifNotExist().create(); | ||
schema.propertyKey("age").asInt().ifNotExist().create(); | ||
schema.propertyKey("lang").asText().ifNotExist().create(); | ||
|
@@ -128,15 +127,14 @@ | |
.property("date", "2017-03-24"); | ||
|
||
List<Vertex> vertices = new ArrayList<Vertex>() {{ | ||
add(peter); | ||
add(lop); | ||
add(vadasB); | ||
}}; | ||
|
||
add(peter); | ||
add(lop); | ||
add(vadasB); | ||
}}; | ||
Check warning on line 133 in hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/reuse/BytesDemo.java Codecov / codecov/patchhugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/reuse/BytesDemo.java#L130-L133
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we keep the origin style? |
||
|
||
List<Edge> edges = new ArrayList<Edge>() {{ | ||
add(peterCreateLop); | ||
}}; | ||
add(peterCreateLop); | ||
}}; | ||
Check warning on line 137 in hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/reuse/BytesDemo.java Codecov / codecov/patchhugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/reuse/BytesDemo.java#L136-L137
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we keep the origin style? |
||
|
||
// Old way: encode to json then send to server | ||
if (bypassServer) { | ||
|
@@ -188,7 +186,6 @@ | |
return flag; | ||
} | ||
|
||
|
||
boolean put(String type, byte[] rowkey, byte[] values) throws IOException { | ||
// TODO: put to HBase | ||
return true; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ | |
|
||
import org.apache.hugegraph.exception.ExternalException; | ||
import org.apache.hugegraph.options.HubbleOptions; | ||
import org.apache.hugegraph.util.Log; | ||
import org.slf4j.Logger; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.ApplicationArguments; | ||
import org.springframework.context.annotation.Bean; | ||
|
@@ -33,6 +35,8 @@ | |
@Configuration | ||
public class HubbleConfig { | ||
|
||
protected static final Logger LOG = Log.logger(HubbleConfig.class); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
@Autowired | ||
private ApplicationArguments arguments; | ||
|
||
|
@@ -57,6 +61,7 @@ public HugeConfig hugeConfig() { | |
conf = path; | ||
} | ||
} catch (Exception ignored) { | ||
LOG.error("hugeConfig exception"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question |
||
} | ||
return new HugeConfig(conf); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -436,7 +436,8 @@ private FileSource buildFileSource(FileMapping fileMapping) { | |
Ex.check(idFields.size() == 1, | ||
"When the ID strategy is CUSTOMIZED, you must " + | ||
"select a column in the file as the id"); | ||
vMapping = new org.apache.hugegraph.loader.mapping.VertexMapping(idFields.get(0), true); | ||
vMapping = new org.apache.hugegraph.loader.mapping.VertexMapping( | ||
idFields.get(0), true); | ||
Comment on lines
+439
to
+440
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if line < 100, use one line instead There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} else { | ||
assert vl.getIdStrategy().isPrimaryKey(); | ||
List<String> primaryKeys = vl.getPrimaryKeys(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,18 +183,18 @@ | |
Map<String, UpdateStrategy> updateStrategyMap = | ||
elementMapping.updateStrategies(); | ||
if (isVertex) { | ||
BatchVertexRequest.Builder req = new BatchVertexRequest.Builder(); | ||
req.vertices((List<Vertex>) (Object) graphElements) | ||
.updatingStrategies(updateStrategyMap) | ||
.createIfNotExist(true); | ||
g.updateVertices(req.build()); | ||
BatchVertexRequest.Builder request = new BatchVertexRequest.Builder(); | ||
request.vertices((List<Vertex>) (Object) graphElements) | ||
.updatingStrategies(updateStrategyMap) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. align with '.' |
||
.createIfNotExist(true); | ||
g.updateVertices(request.build()); | ||
Check warning on line 190 in hugegraph-loader/src/main/java/org/apache/hugegraph/loader/flink/HugeGraphOutputFormat.java Codecov / codecov/patchhugegraph-loader/src/main/java/org/apache/hugegraph/loader/flink/HugeGraphOutputFormat.java#L186-L190
|
||
} else { | ||
BatchEdgeRequest.Builder req = new BatchEdgeRequest.Builder(); | ||
req.edges((List<Edge>) (Object) graphElements) | ||
.updatingStrategies(updateStrategyMap) | ||
.checkVertex(this.loadOptions.checkVertex) | ||
.createIfNotExist(true); | ||
g.updateEdges(req.build()); | ||
BatchEdgeRequest.Builder request = new BatchEdgeRequest.Builder(); | ||
request.edges((List<Edge>) (Object) graphElements) | ||
.updatingStrategies(updateStrategyMap) | ||
.checkVertex(this.loadOptions.checkVertex) | ||
.createIfNotExist(true); | ||
g.updateEdges(request.build()); | ||
Check warning on line 197 in hugegraph-loader/src/main/java/org/apache/hugegraph/loader/flink/HugeGraphOutputFormat.java Codecov / codecov/patchhugegraph-loader/src/main/java/org/apache/hugegraph/loader/flink/HugeGraphOutputFormat.java#L192-L197
|
||
} | ||
break; | ||
case DELETE: | ||
|
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.
mark as private?