-
Notifications
You must be signed in to change notification settings - Fork 94
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 1 commit
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 |
---|---|---|
|
@@ -24,11 +24,15 @@ | |
import org.apache.hugegraph.rest.RestResult; | ||
|
||
import jakarta.ws.rs.core.Response; | ||
import org.apache.hugegraph.util.Log; | ||
import org.slf4j.Logger; | ||
|
||
public class ServerException extends RuntimeException { | ||
|
||
private static final long serialVersionUID = 6335623004322652358L; | ||
|
||
protected static final Logger LOG = Log.logger(ServerException.class); | ||
|
||
private static final String[] EXCEPTION_KEYS = {"exception", | ||
"Exception-Class"}; | ||
private static final String[] MESSAGE_KEYS = {"message"}; | ||
|
@@ -54,6 +58,7 @@ public static ServerException fromResponse(Response response) { | |
exception.cause = (String) getByKeys(json, CAUSE_KEYS); | ||
exception.trace = getByKeys(json, TRACE_KEYS); | ||
} catch (Exception ignored) { | ||
LOG.error(" ServerException excepiton "); | ||
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. we need log here? @javeme and seems have 2 extra spaces |
||
} | ||
|
||
return exception; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,6 @@ void initGraph() { | |
|
||
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 @@ private void writeGraphElements() { | |
.property("date", "2017-03-24"); | ||
|
||
List<Vertex> vertices = new ArrayList<Vertex>() {{ | ||
add(peter); | ||
add(lop); | ||
add(vadasB); | ||
}}; | ||
|
||
add(peter); | ||
add(lop); | ||
add(vadasB); | ||
}}; | ||
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); | ||
}}; | ||
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 @@ boolean sendRpcToHBase(String type, byte[] rowkey, byte[] values) { | |
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(); | ||
|
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?