Class SavepointRuntimeContext
java.lang.Object
org.apache.flink.state.api.runtime.SavepointRuntimeContext
- All Implemented Interfaces:
org.apache.flink.api.common.functions.RuntimeContext
@Internal
public final class SavepointRuntimeContext
extends Object
implements org.apache.flink.api.common.functions.RuntimeContext
A streaming
RuntimeContext which delegates to the underlying batch RuntimeContext
along with a specified KeyedStateStore.
This RuntimeContext has the ability to force eager state registration by throwing an
exception if state is registered outside of open.
-
Constructor Summary
ConstructorsConstructorDescriptionSavepointRuntimeContext(org.apache.flink.api.common.functions.RuntimeContext ctx, org.apache.flink.api.common.state.KeyedStateStore keyedStateStore) -
Method Summary
Modifier and TypeMethodDescription<V,A extends Serializable>
voidaddAccumulator(String name, org.apache.flink.api.common.accumulators.Accumulator<V, A> accumulator) <T> org.apache.flink.api.common.typeutils.TypeSerializer<T>createSerializer(org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInformation) void<V,A extends Serializable>
org.apache.flink.api.common.accumulators.Accumulator<V,A> getAccumulator(String name) <IN,ACC, OUT>
org.apache.flink.api.common.state.AggregatingState<IN,OUT> getAggregatingState(org.apache.flink.api.common.state.AggregatingStateDescriptor<IN, ACC, OUT> stateProperties) <IN,ACC, OUT>
org.apache.flink.api.common.state.v2.AggregatingState<IN,OUT> getAggregatingState(org.apache.flink.api.common.state.v2.AggregatingStateDescriptor<IN, ACC, OUT> stateProperties) <RT> List<RT>getBroadcastVariable(String name) <T,C> C getBroadcastVariableWithInitializer(String name, org.apache.flink.api.common.functions.BroadcastVariableInitializer<T, C> initializer) org.apache.flink.api.common.cache.DistributedCacheorg.apache.flink.api.common.accumulators.DoubleCountergetDoubleCounter(String name) Set<org.apache.flink.api.common.externalresource.ExternalResourceInfo>getExternalResourceInfos(String resourceName) org.apache.flink.api.common.accumulators.HistogramgetHistogram(String name) org.apache.flink.api.common.accumulators.IntCountergetIntCounter(String name) org.apache.flink.api.common.JobInfo<T> org.apache.flink.api.common.state.ListState<T>getListState(org.apache.flink.api.common.state.ListStateDescriptor<T> stateProperties) <T> org.apache.flink.api.common.state.v2.ListState<T>getListState(org.apache.flink.api.common.state.v2.ListStateDescriptor<T> stateProperties) org.apache.flink.api.common.accumulators.LongCountergetLongCounter(String name) <UK,UV> org.apache.flink.api.common.state.MapState<UK, UV> getMapState(org.apache.flink.api.common.state.MapStateDescriptor<UK, UV> stateProperties) <UK,UV> org.apache.flink.api.common.state.v2.MapState<UK, UV> getMapState(org.apache.flink.api.common.state.v2.MapStateDescriptor<UK, UV> stateProperties) org.apache.flink.metrics.groups.OperatorMetricGroup<T> org.apache.flink.api.common.state.ReducingState<T>getReducingState(org.apache.flink.api.common.state.ReducingStateDescriptor<T> stateProperties) <T> org.apache.flink.api.common.state.v2.ReducingState<T>getReducingState(org.apache.flink.api.common.state.v2.ReducingStateDescriptor<T> stateProperties) <T> org.apache.flink.api.common.state.v2.ValueState<T>getState(org.apache.flink.api.common.state.v2.ValueStateDescriptor<T> stateProperties) <T> org.apache.flink.api.common.state.ValueState<T>getState(org.apache.flink.api.common.state.ValueStateDescriptor<T> stateProperties) List<org.apache.flink.api.common.state.StateDescriptor<?,?>> org.apache.flink.api.common.TaskInfobooleanhasBroadcastVariable(String name) booleanvoidregisterUserCodeClassLoaderReleaseHookIfAbsent(String releaseHookName, Runnable releaseHook)
-
Constructor Details
-
SavepointRuntimeContext
public SavepointRuntimeContext(org.apache.flink.api.common.functions.RuntimeContext ctx, org.apache.flink.api.common.state.KeyedStateStore keyedStateStore)
-
-
Method Details
-
getJobInfo
public org.apache.flink.api.common.JobInfo getJobInfo()- Specified by:
getJobInfoin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getTaskInfo
public org.apache.flink.api.common.TaskInfo getTaskInfo()- Specified by:
getTaskInfoin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getMetricGroup
public org.apache.flink.metrics.groups.OperatorMetricGroup getMetricGroup()- Specified by:
getMetricGroupin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
createSerializer
public <T> org.apache.flink.api.common.typeutils.TypeSerializer<T> createSerializer(org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInformation) - Specified by:
createSerializerin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getGlobalJobParameters
- Specified by:
getGlobalJobParametersin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
isObjectReuseEnabled
public boolean isObjectReuseEnabled()- Specified by:
isObjectReuseEnabledin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getUserCodeClassLoader
- Specified by:
getUserCodeClassLoaderin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
registerUserCodeClassLoaderReleaseHookIfAbsent
public void registerUserCodeClassLoaderReleaseHookIfAbsent(String releaseHookName, Runnable releaseHook) - Specified by:
registerUserCodeClassLoaderReleaseHookIfAbsentin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
addAccumulator
public <V,A extends Serializable> void addAccumulator(String name, org.apache.flink.api.common.accumulators.Accumulator<V, A> accumulator) - Specified by:
addAccumulatorin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getAccumulator
public <V,A extends Serializable> org.apache.flink.api.common.accumulators.Accumulator<V,A> getAccumulator(String name) - Specified by:
getAccumulatorin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getIntCounter
- Specified by:
getIntCounterin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getLongCounter
- Specified by:
getLongCounterin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getDoubleCounter
- Specified by:
getDoubleCounterin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getHistogram
- Specified by:
getHistogramin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getExternalResourceInfos
public Set<org.apache.flink.api.common.externalresource.ExternalResourceInfo> getExternalResourceInfos(String resourceName) - Specified by:
getExternalResourceInfosin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
hasBroadcastVariable
- Specified by:
hasBroadcastVariablein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getBroadcastVariable
- Specified by:
getBroadcastVariablein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getBroadcastVariableWithInitializer
public <T,C> C getBroadcastVariableWithInitializer(String name, org.apache.flink.api.common.functions.BroadcastVariableInitializer<T, C> initializer) - Specified by:
getBroadcastVariableWithInitializerin interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getDistributedCache
public org.apache.flink.api.common.cache.DistributedCache getDistributedCache()- Specified by:
getDistributedCachein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getState
public <T> org.apache.flink.api.common.state.ValueState<T> getState(org.apache.flink.api.common.state.ValueStateDescriptor<T> stateProperties) - Specified by:
getStatein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getListState
public <T> org.apache.flink.api.common.state.ListState<T> getListState(org.apache.flink.api.common.state.ListStateDescriptor<T> stateProperties) - Specified by:
getListStatein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getReducingState
public <T> org.apache.flink.api.common.state.ReducingState<T> getReducingState(org.apache.flink.api.common.state.ReducingStateDescriptor<T> stateProperties) - Specified by:
getReducingStatein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getAggregatingState
public <IN,ACC, org.apache.flink.api.common.state.AggregatingState<IN,OUT> OUT> getAggregatingState(org.apache.flink.api.common.state.AggregatingStateDescriptor<IN, ACC, OUT> stateProperties) - Specified by:
getAggregatingStatein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getMapState
public <UK,UV> org.apache.flink.api.common.state.MapState<UK,UV> getMapState(org.apache.flink.api.common.state.MapStateDescriptor<UK, UV> stateProperties) - Specified by:
getMapStatein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getState
public <T> org.apache.flink.api.common.state.v2.ValueState<T> getState(org.apache.flink.api.common.state.v2.ValueStateDescriptor<T> stateProperties) - Specified by:
getStatein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getListState
public <T> org.apache.flink.api.common.state.v2.ListState<T> getListState(org.apache.flink.api.common.state.v2.ListStateDescriptor<T> stateProperties) - Specified by:
getListStatein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getReducingState
public <T> org.apache.flink.api.common.state.v2.ReducingState<T> getReducingState(org.apache.flink.api.common.state.v2.ReducingStateDescriptor<T> stateProperties) - Specified by:
getReducingStatein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getAggregatingState
public <IN,ACC, org.apache.flink.api.common.state.v2.AggregatingState<IN,OUT> OUT> getAggregatingState(org.apache.flink.api.common.state.v2.AggregatingStateDescriptor<IN, ACC, OUT> stateProperties) - Specified by:
getAggregatingStatein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getMapState
public <UK,UV> org.apache.flink.api.common.state.v2.MapState<UK,UV> getMapState(org.apache.flink.api.common.state.v2.MapStateDescriptor<UK, UV> stateProperties) - Specified by:
getMapStatein interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getStateDescriptors
-
disableStateRegistration
- Throws:
Exception
-