Package org.apache.flink.changelog.fs
Interface TaskChangelogRegistry
-
@Internal public interface TaskChangelogRegistryTM-side registry ofStateObjects, each representing one or more changelog segments. Changelog segments are uploaded byStateChangelogWritersof aStateChangelogStorage.Initially, when
starting the tracking, the ownership of a changelog segments is not clear, and it is assumed that JM might be the owner. The refCount of the StateObject refers to the number of changelog segments contains in the StateObject.release(StreamStateHandle)should be called when every changelog segment become not used, and it will count down the refCount by one. Once the refCount reaches zero, JM can not become an owner anymore, the state is discarded.However, if at any point it becomes known that JM is the owner, tracking is
stoppedand the state will not be discarded.It is the client responsibility to call
release(StreamStateHandle)when every corresponding changelog segment becomes not used.
-
-
Field Summary
Fields Modifier and Type Field Description static TaskChangelogRegistryNO_OP
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static TaskChangelogRegistrydefaultChangelogRegistry(int numAsyncDiscardThreads)static TaskChangelogRegistrydefaultChangelogRegistry(Executor executor)voidrelease(org.apache.flink.runtime.state.StreamStateHandle handle)Decrease the reference count of the state by one, e.g.voidstartTracking(org.apache.flink.runtime.state.StreamStateHandle handle, long refCount)Start tracking the state uploaded.voidstopTracking(org.apache.flink.runtime.state.StreamStateHandle handle)Stop tracking the state, so that it's not tracked (some other component is doing that).
-
-
-
Field Detail
-
NO_OP
static final TaskChangelogRegistry NO_OP
-
-
Method Detail
-
startTracking
void startTracking(org.apache.flink.runtime.state.StreamStateHandle handle, long refCount)Start tracking the state uploaded. The refCount is the number of StateChangeSets.
-
stopTracking
void stopTracking(org.apache.flink.runtime.state.StreamStateHandle handle)
Stop tracking the state, so that it's not tracked (some other component is doing that).
-
release
void release(org.apache.flink.runtime.state.StreamStateHandle handle)
Decrease the reference count of the state by one, e.g. if it was pre-emptively uploaded and materialized. Once the reference count reaches zero, it is discarded (unless it wasunregisteredearlier).
-
defaultChangelogRegistry
static TaskChangelogRegistry defaultChangelogRegistry(int numAsyncDiscardThreads)
-
defaultChangelogRegistry
@VisibleForTesting static TaskChangelogRegistry defaultChangelogRegistry(Executor executor)
-
-