public class GradoopId extends Object implements org.apache.flink.types.NormalizableKey<GradoopId>, org.apache.flink.types.CopyableValue<GradoopId>
This implementation reuses much of the code of BSON's ObjectId (org.bson.types.ObjectId) to guarantee uniqueness. Much of the code is copied directly or has only small changes.
| Modifier and Type | Field and Description |
|---|---|
static int |
ID_SIZE
Number of bytes to represent an id internally.
|
static GradoopId |
NULL_VALUE
Represents a null id.
|
| Constructor and Description |
|---|
GradoopId()
Required default constructor for instantiation by serialization logic.
|
GradoopId(int timestamp,
int machineIdentifier,
short processIdentifier,
int counter)
Creates a GradoopId using the given time, machine identifier, process identifier, and counter.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(GradoopId other)
Performs a byte-wise comparison of this and the specified GradoopId.
|
GradoopId |
copy() |
void |
copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target) |
void |
copyNormalizedKey(org.apache.flink.core.memory.MemorySegment target,
int offset,
int len) |
void |
copyTo(GradoopId target) |
boolean |
equals(Object o)
Checks if the specified object is equal to the current id.
|
static GradoopId |
fromByteArray(byte[] bytes)
Returns the Gradoop ID represented by a byte array
|
static GradoopId |
fromString(String string)
Returns the Gradoop ID represented by a specified hexadecimal string.
|
static GradoopId |
get()
Returns a new GradoopId
|
int |
getBinaryLength() |
int |
getMaxNormalizedKeyLen() |
int |
hashCode()
Returns the hash code of this GradoopId.
|
static boolean |
isValid(String hexString)
Checks if a string can be transformed into a GradoopId.
|
static GradoopId |
min(GradoopId first,
GradoopId second)
Compares the given GradoopIds and returns the smaller one.
|
void |
read(org.apache.flink.core.memory.DataInputView in) |
byte[] |
toByteArray()
Returns byte representation of a GradoopId
|
String |
toString()
Returns hex string representation of a GradoopId.
|
void |
write(org.apache.flink.core.memory.DataOutputView out) |
public static final int ID_SIZE
public static final GradoopId NULL_VALUE
public GradoopId()
public GradoopId(int timestamp,
int machineIdentifier,
short processIdentifier,
int counter)
Note: Implementation taken from org.bson.types.ObjectId
timestamp - the time in secondsmachineIdentifier - the machine identifierprocessIdentifier - the process identifiercounter - the counterIllegalArgumentException - if the high order byte of machineIdentifier
or counter is not zeropublic static GradoopId get()
public static GradoopId fromString(String string)
Note: Implementation taken from org.bson.types.ObjectId
string - hexadecimal GradoopId representationpublic static boolean isValid(String hexString)
Note: Implementation taken from org.bson.types.ObjectId
hexString - a potential GradoopId as a String.IllegalArgumentException - if hexString is nullpublic static GradoopId fromByteArray(byte[] bytes)
bytes - byte representationpublic byte[] toByteArray()
public boolean equals(Object o)
public int hashCode()
Note: Implementation taken from org.bson.types.ObjectId
public int compareTo(GradoopId other)
compareTo in interface Comparable<GradoopId>other - the object to be compared.public String toString()
Note: Implementation taken from org.bson.types.ObjectId
public int getMaxNormalizedKeyLen()
getMaxNormalizedKeyLen in interface org.apache.flink.types.NormalizableKey<GradoopId>public void copyNormalizedKey(org.apache.flink.core.memory.MemorySegment target,
int offset,
int len)
copyNormalizedKey in interface org.apache.flink.types.NormalizableKey<GradoopId>public void write(org.apache.flink.core.memory.DataOutputView out)
throws IOException
write in interface org.apache.flink.core.io.IOReadableWritableIOExceptionpublic void read(org.apache.flink.core.memory.DataInputView in)
throws IOException
read in interface org.apache.flink.core.io.IOReadableWritableIOExceptionpublic int getBinaryLength()
getBinaryLength in interface org.apache.flink.types.CopyableValue<GradoopId>public void copyTo(GradoopId target)
copyTo in interface org.apache.flink.types.CopyableValue<GradoopId>public GradoopId copy()
copy in interface org.apache.flink.types.CopyableValue<GradoopId>public void copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target)
throws IOException
copy in interface org.apache.flink.types.CopyableValue<GradoopId>IOExceptionCopyright © 2014 - 2019–2019 University of Leipzig. All rights reserved.