public class CheckpointV2 extends java.lang.Object implements Checkpoint
StreamTask
, either as part of a job restart or as part
of restarting a failed container within a running job.Modifier and Type | Field and Description |
---|---|
static short |
CHECKPOINT_VERSION |
Constructor and Description |
---|
CheckpointV2(CheckpointId checkpointId,
java.util.Map<SystemStreamPartition,java.lang.String> inputOffsets,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> stateCheckpoints)
Constructs the checkpoint with separated input and state offsets
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
CheckpointId |
getCheckpointId()
Gets the checkpoint id for the checkpoint
|
java.util.Map<SystemStreamPartition,java.lang.String> |
getOffsets()
Gets a unmodifiable view of the current input
SystemStreamPartition offsets. |
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
getStateCheckpointMarkers()
Gets the state checkpoint markers for all stores for each configured state backend.
|
short |
getVersion()
Gets the version number of the Checkpoint
|
int |
hashCode() |
java.lang.String |
toString() |
public static final short CHECKPOINT_VERSION
public CheckpointV2(CheckpointId checkpointId, java.util.Map<SystemStreamPartition,java.lang.String> inputOffsets, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> stateCheckpoints)
checkpointId
- CheckpointId
associated with this checkpointinputOffsets
- Map of Samza system stream partition to offset of the checkpointstateCheckpoints
- Map of state backend factory name to map of local state store names
to state checkpointspublic short getVersion()
Checkpoint
getVersion
in interface Checkpoint
public CheckpointId getCheckpointId()
public java.util.Map<SystemStreamPartition,java.lang.String> getOffsets()
SystemStreamPartition
offsets.getOffsets
in interface Checkpoint
SystemStreamPartition
s to their recorded offsets.public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getStateCheckpointMarkers()
Checkpoint
interface since it is difficult
to implement it for CheckpointV1
without changing the underlying serialization format -
the changelog SSP offsets are serialized in the same way as input offsets, and at
deserialization time we don't have enough information (e.g. configs) to decide whether a
particular entry is for an input SSP or a changelog SSP.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object