Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -241,7 +241,7 @@ protected Object[] asArray(List<Object> 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;
Expand Down Expand Up @@ -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 extends Relationship> T fromEdge(Edge edge,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Id, Object> verticesCache;
private final Cache<Id, Object> edgesCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

public class OffheapCache extends AbstractCache<Id, Object> {

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<Id, Value> cache;
private final HugeGraph graph;
Expand Down Expand Up @@ -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;
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
Expand All @@ -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));
Expand All @@ -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());
Expand All @@ -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;
}
Expand All @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public V call() throws Exception {
};
}

public static abstract class SysTaskCallable<V> extends TaskCallable<V> {
public abstract static class SysTaskCallable<V> extends TaskCallable<V> {

private HugeGraphParams params = null;

Expand Down