Package org.apache.flink.state.changelog
Interface StateChangeLogger<Value,Namespace>
-
- Type Parameters:
Value- type of state (value)Namespace- type of namespace
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Subinterfaces:
KvStateChangeLogger<Value,Namespace>
@Internal public interface StateChangeLogger<Value,Namespace> extends Closeable
Logs changes to a state created byChangelogKeyedStateBackend. The changes are intended to be stored durably, included into a checkpoint and replayed on recovery in case of failure.Note that the order of updating the delegated state and logging it using this class usually doesn't matter. However in some cases an already updated state needs to be logged. Besides that, delegated state update is usually local and would fail faster. Therefore, consider updating the delegated state first and logging the change second.
If state update succeeds and changelog append fails immediately then the updated change is discarded as no checkpoints can proceed.
If changelog append fails asynchronously then subsequent checkpoints can only succeed after state materialization.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidresetWritingMetaFlag()Enable logging meta data before next writes.voidvalueAdded(Value addedValue, Namespace ns)State added, such as append to list.addAll.voidvalueCleared(Namespace ns)State cleared.voidvalueElementAdded(org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.core.memory.DataOutputView,IOException> dataSerializer, Namespace ns)State element added, such as append of a single element to a list.voidvalueElementAddedOrUpdated(org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.core.memory.DataOutputView,IOException> dataSerializer, Namespace ns)State element added or updated, such as put into a map.voidvalueElementRemoved(org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.core.memory.DataOutputView,IOException> dataSerializer, Namespace ns)State element removed, such mapping removal from a map.voidvalueUpdated(Value newValue, Namespace ns)State updated, such as byListState.update(java.util.List<T>).voidvalueUpdatedInternal(Value newValue, Namespace ns)State update internally (usually with a value that the user has no control over).
-
-
-
Method Detail
-
valueUpdated
void valueUpdated(Value newValue, Namespace ns) throws IOException
State updated, such as byListState.update(java.util.List<T>).- Throws:
IOException
-
valueUpdatedInternal
void valueUpdatedInternal(Value newValue, Namespace ns) throws IOException
State update internally (usually with a value that the user has no control over).- Throws:
IOException
-
valueAdded
void valueAdded(Value addedValue, Namespace ns) throws IOException
State added, such as append to list.addAll.- Throws:
IOException
-
valueCleared
void valueCleared(Namespace ns) throws IOException
State cleared.- Throws:
IOException
-
valueElementAdded
void valueElementAdded(org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.core.memory.DataOutputView,IOException> dataSerializer, Namespace ns) throws IOException
State element added, such as append of a single element to a list.- Throws:
IOException
-
valueElementAddedOrUpdated
void valueElementAddedOrUpdated(org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.core.memory.DataOutputView,IOException> dataSerializer, Namespace ns) throws IOException
State element added or updated, such as put into a map.- Throws:
IOException
-
valueElementRemoved
void valueElementRemoved(org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.core.memory.DataOutputView,IOException> dataSerializer, Namespace ns) throws IOException
State element removed, such mapping removal from a map.- Throws:
IOException
-
resetWritingMetaFlag
void resetWritingMetaFlag()
Enable logging meta data before next writes.
-
-