forked from JanusGraph/janusgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request JanusGraph#148 from amcp/fixBlueprintsCustomIds
Enable setting custom vertex ids in TP3 interface JanusGraph#147
- Loading branch information
Showing
5 changed files
with
137 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,17 @@ | |
* Utility methods for handling JanusGraph ids and converting them between indexing and storage backend representations. | ||
* | ||
* @author Matthias Broecheler ([email protected]) | ||
* @deprecated This class does not produce valid JanusGraph vertex ids as it does not take into account partitioning | ||
* bits used in vertex id assignment. Use {@link org.janusgraph.graphdb.idmanagement.IDManager}, which can be obtained | ||
* through {@link org.janusgraph.graphdb.database.StandardJanusGraph#getIDManager()} and includes methods for converting | ||
* a user id to ({@link org.janusgraph.graphdb.idmanagement.IDManager#toVertexId(long)}) and from | ||
* ({@link org.janusgraph.graphdb.idmanagement.IDManager#fromVertexId(long)}) JanusGraph vertex id. | ||
* <p/> | ||
* <pre> | ||
* <code>IDManager idManager = ((StandardJanusGraph) graph).getIDManager();</code> | ||
* </pre> | ||
*/ | ||
@Deprecated | ||
public class JanusGraphId { | ||
|
||
/** | ||
|
@@ -31,6 +41,7 @@ public class JanusGraphId { | |
* | ||
* @param id long id | ||
* @return a corresponding JanusGraph vertex id | ||
* @deprecated Use {@link org.janusgraph.graphdb.idmanagement.IDManager#toVertexId(long)}. | ||
*/ | ||
public static final long toVertexId(long id) { | ||
Preconditions.checkArgument(id > 0, "Vertex id must be positive: %s", id); | ||
|
@@ -43,6 +54,7 @@ public static final long toVertexId(long id) { | |
* | ||
* @param id JanusGraph vertex id (must be positive) | ||
* @return original user provided id | ||
* @deprecated Use {@link org.janusgraph.graphdb.idmanagement.IDManager#fromVertexId(long)} | ||
*/ | ||
public static final long fromVertexId(long id) { | ||
Preconditions.checkArgument(id > 0, "Invalid vertex id provided: %s", id); | ||
|
@@ -54,6 +66,7 @@ public static final long fromVertexId(long id) { | |
* | ||
* @param v Vertex | ||
* @return original user provided id | ||
* @deprecated Use {@link org.janusgraph.graphdb.idmanagement.IDManager#fromVertexId(long)} | ||
*/ | ||
public static final long fromVertexID(JanusGraphVertex v) { | ||
Preconditions.checkArgument(v.hasId(), "Invalid vertex provided: %s", v); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters