From 59e78666bf452ecfb8ad9ebeeb8ac23e5c650907 Mon Sep 17 00:00:00 2001 From: seagle Date: Fri, 22 Apr 2022 21:25:09 +0800 Subject: [PATCH 1/4] delete whitespace before ';' --- .../src/main/java/com/baidu/hugegraph/auth/EntityManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/EntityManager.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/EntityManager.java index c4b668e619..0ff8c0ca2c 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/EntityManager.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/EntityManager.java @@ -73,7 +73,7 @@ private HugeGraph graph() { } private String unhideLabel() { - return Hidden.unHide(this.label) ; + return Hidden.unHide(this.label); } public Id add(T entity) { From 4b9725c07a091679c7332ffe26549cf586f863c7 Mon Sep 17 00:00:00 2001 From: seagle Date: Mon, 25 Apr 2022 17:46:20 +0800 Subject: [PATCH 2/4] empty commit From a8f96ab2d70263034f70189c9db684fafad93f49 Mon Sep 17 00:00:00 2001 From: seagle Date: Mon, 25 Apr 2022 21:03:48 +0800 Subject: [PATCH 3/4] Checkstyle modifier order --- .../hugegraph/auth/RelationshipManager.java | 2 +- .../com/baidu/hugegraph/auth/SchemaDefine.java | 10 ++++++---- .../backend/cache/CachedGraphTransaction.java | 10 +++++----- .../hugegraph/backend/cache/OffheapCache.java | 4 ++-- .../hugegraph/backend/id/IdGenerator.java | 18 +++++++++--------- .../com/baidu/hugegraph/task/TaskCallable.java | 2 +- 6 files changed, 24 insertions(+), 22 deletions(-) diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/RelationshipManager.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/RelationshipManager.java index 1fb3232fd5..667927d026 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/RelationshipManager.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/RelationshipManager.java @@ -77,7 +77,7 @@ private HugeGraph graph() { } private String unhideLabel() { - return Hidden.unHide(this.label) ; + return Hidden.unHide(this.label); } public Id add(T relationship) { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/SchemaDefine.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/SchemaDefine.java index 3ffc1d883a..12ed87ce05 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/SchemaDefine.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/auth/SchemaDefine.java @@ -56,7 +56,7 @@ public SchemaDefine(HugeGraphParams graph, String label) { public abstract void initSchemaIfNeeded(); protected SchemaManager schema() { - return this.graph.graph().schema(); + return this.graph.graph().schema(); } protected boolean existVertexLabel(String label) { @@ -116,7 +116,7 @@ protected static String unhideField(String label, String key) { return Hidden.unHide(label) + "_" + key; } - public static abstract class AuthElement implements Serializable { + public abstract static class AuthElement implements Serializable { private static final long serialVersionUID = 8746691160192814973L; @@ -241,7 +241,7 @@ protected Object[] asArray(List list) { } // NOTE: travis-ci fails if class Entity implements Nameable - public static abstract class Entity extends AuthElement + public abstract static class Entity extends AuthElement implements com.baidu.hugegraph.type.Nameable { private static final long serialVersionUID = 4113319546914811762L; @@ -270,14 +270,16 @@ public String idString() { } } - public static abstract class Relationship extends AuthElement { + public abstract static class Relationship extends AuthElement { private static final long serialVersionUID = -1406157381685832493L; public abstract String sourceLabel(); + public abstract String targetLabel(); public abstract Id source(); + public abstract Id target(); public static T fromEdge(Edge edge, diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedGraphTransaction.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedGraphTransaction.java index eb064f14d0..fa397862f4 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedGraphTransaction.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedGraphTransaction.java @@ -55,11 +55,11 @@ public final class CachedGraphTransaction extends GraphTransaction { - private final static int MAX_CACHE_PROPS_PER_VERTEX = 10000; - private final static int MAX_CACHE_EDGES_PER_QUERY = 100; - private final static float DEFAULT_LEVEL_RATIO = 0.001f; - private final static long AVG_VERTEX_ENTRY_SIZE = 40L; - private final static long AVG_EDGE_ENTRY_SIZE = 100L; + private static final int MAX_CACHE_PROPS_PER_VERTEX = 10000; + private static final int MAX_CACHE_EDGES_PER_QUERY = 100; + private static final float DEFAULT_LEVEL_RATIO = 0.001f; + private static final long AVG_VERTEX_ENTRY_SIZE = 40L; + private static final long AVG_EDGE_ENTRY_SIZE = 100L; private final Cache verticesCache; private final Cache edgesCache; diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/OffheapCache.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/OffheapCache.java index a890410e47..993809750b 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/OffheapCache.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/OffheapCache.java @@ -51,7 +51,7 @@ public class OffheapCache extends AbstractCache { - private final static long VALUE_SIZE_TO_SKIP = 100 * Bytes.KB; + private static final long VALUE_SIZE_TO_SKIP = 100 * Bytes.KB; private final OHCache cache; private final HugeGraph graph; @@ -128,7 +128,7 @@ protected boolean write(Id id, Object value, long timeOffset) { long expireTime = this.expire(); boolean success; if (expireTime <= 0L) { - success = this.cache.put(id, serializedValue); + success = this.cache.put(id, serializedValue); } else { expireTime += now() + timeOffset; /* diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/id/IdGenerator.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/id/IdGenerator.java index 1858fb4c0b..3ab42ee77e 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/id/IdGenerator.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/id/IdGenerator.java @@ -36,19 +36,19 @@ public abstract class IdGenerator { public abstract Id generate(HugeVertex vertex); - public final static Id of(String id) { + public static final Id of(String id) { return new StringId(id); } - public final static Id of(UUID id) { + public static final Id of(UUID id) { return new UuidId(id); } - public final static Id of(String id, boolean uuid) { + public static final Id of(String id, boolean uuid) { return uuid ? new UuidId(id) : new StringId(id); } - public final static Id of(long id) { + public static final Id of(long id) { return new LongId(id); } @@ -65,7 +65,7 @@ public static Id of(Object id) { return new ObjectId(id); } - public final static Id of(byte[] bytes, IdType type) { + public static final Id of(byte[] bytes, IdType type) { switch (type) { case LONG: return new LongId(bytes); @@ -78,7 +78,7 @@ public final static Id of(byte[] bytes, IdType type) { } } - public final static Id ofStoredString(String id, IdType type) { + public static final Id ofStoredString(String id, IdType type) { switch (type) { case LONG: return of(LongEncoding.decodeSignedB64(id)); @@ -92,7 +92,7 @@ public final static Id ofStoredString(String id, IdType type) { } } - public final static String asStoredString(Id id) { + public static final String asStoredString(Id id) { switch (id.type()) { case LONG: return LongEncoding.encodeSignedB64(id.asLong()); @@ -105,7 +105,7 @@ public final static String asStoredString(Id id) { } } - public final static IdType idType(Id id) { + public static final IdType idType(Id id) { if (id instanceof LongId) { return IdType.LONG; } @@ -121,7 +121,7 @@ public final static IdType idType(Id id) { return IdType.UNKNOWN; } - private final static int compareType(Id id1, Id id2) { + private static final int compareType(Id id1, Id id2) { return idType(id1).ordinal() - idType(id2).ordinal(); } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/task/TaskCallable.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/task/TaskCallable.java index 9b1159d709..8cdaa98fb7 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/task/TaskCallable.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/task/TaskCallable.java @@ -174,7 +174,7 @@ public V call() throws Exception { }; } - public static abstract class SysTaskCallable extends TaskCallable { + public abstract static class SysTaskCallable extends TaskCallable { private HugeGraphParams params = null; From 0a941836eceeb035c93d761372886c92a3ee3801 Mon Sep 17 00:00:00 2001 From: seagle Date: Mon, 25 Apr 2022 21:45:29 +0800 Subject: [PATCH 4/4] empty commit