public class SerializedCheckpointData extends Object implements Serializable
Constructor and Description |
---|
SerializedCheckpointData(long checkpointId,
byte[] serializedData,
int numIds)
Creates a SerializedCheckpointData object for the given serialized data.
|
Modifier and Type | Method and Description |
---|---|
static <T> SerializedCheckpointData[] |
fromDeque(ArrayDeque<Tuple2<Long,List<T>>> checkpoints,
TypeSerializer<T> serializer)
Converts a list of checkpoints with elements into an array of SerializedCheckpointData.
|
static <T> SerializedCheckpointData[] |
fromDeque(ArrayDeque<Tuple2<Long,List<T>>> checkpoints,
TypeSerializer<T> serializer,
DataOutputSerializer outputBuffer)
Converts a list of checkpoints into an array of SerializedCheckpointData.
|
long |
getCheckpointId()
Gets the checkpointId of the checkpoint.
|
int |
getNumIds()
Gets the number of IDs in the checkpoint.
|
byte[] |
getSerializedData()
Gets the binary data for the serialized elements.
|
static <T> ArrayDeque<Tuple2<Long,List<T>>> |
toDeque(SerializedCheckpointData[] data,
TypeSerializer<T> serializer)
De-serializes an array of SerializedCheckpointData back into an ArrayDeque of element checkpoints.
|
public SerializedCheckpointData(long checkpointId, byte[] serializedData, int numIds)
checkpointId
- The checkpointId of the checkpoint.serializedData
- The serialized IDs in this checkpoint.numIds
- The number of IDs in the checkpoint.public long getCheckpointId()
public byte[] getSerializedData()
public int getNumIds()
public static <T> SerializedCheckpointData[] fromDeque(ArrayDeque<Tuple2<Long,List<T>>> checkpoints, TypeSerializer<T> serializer) throws IOException
T
- The type of the ID.checkpoints
- The checkpoints to be converted into IdsCheckpointData.serializer
- The serializer to serialize the IDs.IOException
- Thrown, if the serialization fails.public static <T> SerializedCheckpointData[] fromDeque(ArrayDeque<Tuple2<Long,List<T>>> checkpoints, TypeSerializer<T> serializer, DataOutputSerializer outputBuffer) throws IOException
T
- The type of the ID.checkpoints
- The checkpoints to be converted into IdsCheckpointData.serializer
- The serializer to serialize the IDs.outputBuffer
- The reusable serialization buffer.IOException
- Thrown, if the serialization fails.public static <T> ArrayDeque<Tuple2<Long,List<T>>> toDeque(SerializedCheckpointData[] data, TypeSerializer<T> serializer) throws IOException
T
- The type of the elements.data
- The data to be deserialized.serializer
- The serializer used to deserialize the data.IOException
- Thrown, if the serialization fails.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.