public class IDHandler extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IDHandler.DirectionID |
static class |
IDHandler.RelationTypeParse |
Modifier and Type | Field and Description |
---|---|
static StaticBuffer |
MAX_KEY |
static StaticBuffer |
MIN_KEY |
static byte |
STOP_MASK |
static byte |
STRING_ID_MARKER
See
VariableString for more detail. |
Constructor and Description |
---|
IDHandler() |
Modifier and Type | Method and Description |
---|---|
static StaticBuffer[] |
getBounds(RelationCategory type,
boolean systemTypes) |
static StaticBuffer |
getRelationType(long relationTypeId,
IDHandler.DirectionID dirID,
boolean invisible) |
static long |
readInlineRelationType(ReadBuffer in) |
static IDHandler.RelationTypeParse |
readRelationType(ReadBuffer in) |
static Object |
readVertexId(ReadBuffer in,
boolean forward) |
static int |
relationTypeLength(long relationTypeId) |
static void |
writeInlineRelationType(WriteBuffer out,
long relationTypeId) |
static void |
writeRelationType(WriteBuffer out,
long relationTypeId,
IDHandler.DirectionID dirID,
boolean invisible)
The edge type is written as follows: [ Invisible & System (2 bit) | Relation-Type-ID (1 bit) | Relation-Type-Count (variable) | Direction-ID (1 bit)]
Would only need 1 bit to store relation-type-id, but using two so we can upper bound.
|
static void |
writeVertexId(DataOutput out,
Object id,
boolean forward) |
public static final StaticBuffer MIN_KEY
public static final StaticBuffer MAX_KEY
public static final byte STOP_MASK
public static final byte STRING_ID_MARKER
VariableString
for more detail. This marker has highest
bit being one. When JanusGraph sees it, it knows the buffer stores
a string ID rather than a positive long ID (whose highest bit is zero).public static int relationTypeLength(long relationTypeId)
public static void writeRelationType(WriteBuffer out, long relationTypeId, IDHandler.DirectionID dirID, boolean invisible)
out
- relationTypeId
- dirID
- public static StaticBuffer getRelationType(long relationTypeId, IDHandler.DirectionID dirID, boolean invisible)
public static IDHandler.RelationTypeParse readRelationType(ReadBuffer in)
public static void writeInlineRelationType(WriteBuffer out, long relationTypeId)
public static long readInlineRelationType(ReadBuffer in)
public static StaticBuffer[] getBounds(RelationCategory type, boolean systemTypes)
public static void writeVertexId(DataOutput out, Object id, boolean forward)
public static Object readVertexId(ReadBuffer in, boolean forward)
Copyright © 2012–2024. All rights reserved.