Package org.apache.flink.api.common
Class JobID
- java.lang.Object
-
- org.apache.flink.util.AbstractID
-
- org.apache.flink.api.common.JobID
-
- All Implemented Interfaces:
Serializable,Comparable<AbstractID>
@Public public final class JobID extends AbstractID
Unique (at least statistically unique) identifier for a Flink Job. Jobs in Flink correspond to dataflow graphs.Jobs act simultaneously as sessions, because jobs can be created and submitted incrementally in different parts. Newer fragments of a graph can be attached to existing graphs, thereby extending the current data flow graphs.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.flink.util.AbstractID
lowerPart, SIZE, upperPart
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JobIDfromByteArray(byte[] bytes)Creates a new JobID from the given byte sequence.static JobIDfromByteBuffer(ByteBuffer buf)static JobIDfromHexString(String hexString)Parses a JobID from the given string.static JobIDgenerate()Creates a new (statistically) random JobID.-
Methods inherited from class org.apache.flink.util.AbstractID
compareTo, equals, getBytes, getLowerPart, getUpperPart, hashCode, toHexString, toString
-
-
-
-
Constructor Detail
-
JobID
public JobID()
Creates a new (statistically) random JobID.
-
JobID
public JobID(long lowerPart, long upperPart)Creates a new JobID, using the given lower and upper parts.- Parameters:
lowerPart- The lower 8 bytes of the ID.upperPart- The upper 8 bytes of the ID.
-
JobID
public JobID(byte[] bytes)
Creates a new JobID from the given byte sequence. The byte sequence must be exactly 16 bytes long. The first eight bytes make up the lower part of the ID, while the next 8 bytes make up the upper part of the ID.- Parameters:
bytes- The byte sequence.
-
-
Method Detail
-
generate
public static JobID generate()
Creates a new (statistically) random JobID.- Returns:
- A new random JobID.
-
fromByteArray
public static JobID fromByteArray(byte[] bytes)
Creates a new JobID from the given byte sequence. The byte sequence must be exactly 16 bytes long. The first eight bytes make up the lower part of the ID, while the next 8 bytes make up the upper part of the ID.- Parameters:
bytes- The byte sequence.- Returns:
- A new JobID corresponding to the ID encoded in the bytes.
-
fromByteBuffer
public static JobID fromByteBuffer(ByteBuffer buf)
-
fromHexString
public static JobID fromHexString(String hexString)
Parses a JobID from the given string.- Parameters:
hexString- string representation of a JobID- Returns:
- Parsed JobID
- Throws:
IllegalArgumentException- if the JobID could not be parsed from the given string
-
-