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 streamingRuntimeContext
which delegates to the underlying batchRuntimeContext
along with a specifiedKeyedStateStore
.This
RuntimeContext
has the ability to force eager state registration by throwing an exception if state is registered outside of open.
-
-
Constructor Summary
Constructors Constructor Description SavepointRuntimeContext(org.apache.flink.api.common.functions.RuntimeContext ctx, org.apache.flink.api.common.state.KeyedStateStore keyedStateStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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
disableStateRegistration()
<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>
CgetBroadcastVariableWithInitializer(String name, org.apache.flink.api.common.functions.BroadcastVariableInitializer<T,C> initializer)
org.apache.flink.api.common.cache.DistributedCache
getDistributedCache()
org.apache.flink.api.common.accumulators.DoubleCounter
getDoubleCounter(String name)
Set<org.apache.flink.api.common.externalresource.ExternalResourceInfo>
getExternalResourceInfos(String resourceName)
Map<String,String>
getGlobalJobParameters()
org.apache.flink.api.common.accumulators.Histogram
getHistogram(String name)
org.apache.flink.api.common.accumulators.IntCounter
getIntCounter(String name)
org.apache.flink.api.common.JobInfo
getJobInfo()
<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.LongCounter
getLongCounter(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
getMetricGroup()
<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<?,?>>
getStateDescriptors()
org.apache.flink.api.common.TaskInfo
getTaskInfo()
ClassLoader
getUserCodeClassLoader()
boolean
hasBroadcastVariable(String name)
boolean
isObjectReuseEnabled()
void
registerUserCodeClassLoaderReleaseHookIfAbsent(String releaseHookName, Runnable releaseHook)
-
-
-
Method Detail
-
getJobInfo
public org.apache.flink.api.common.JobInfo getJobInfo()
- Specified by:
getJobInfo
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getTaskInfo
public org.apache.flink.api.common.TaskInfo getTaskInfo()
- Specified by:
getTaskInfo
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getMetricGroup
public org.apache.flink.metrics.groups.OperatorMetricGroup getMetricGroup()
- Specified by:
getMetricGroup
in 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:
createSerializer
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getGlobalJobParameters
public Map<String,String> getGlobalJobParameters()
- Specified by:
getGlobalJobParameters
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
isObjectReuseEnabled
public boolean isObjectReuseEnabled()
- Specified by:
isObjectReuseEnabled
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getUserCodeClassLoader
public ClassLoader getUserCodeClassLoader()
- Specified by:
getUserCodeClassLoader
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
registerUserCodeClassLoaderReleaseHookIfAbsent
public void registerUserCodeClassLoaderReleaseHookIfAbsent(String releaseHookName, Runnable releaseHook)
- Specified by:
registerUserCodeClassLoaderReleaseHookIfAbsent
in 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:
addAccumulator
in 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:
getAccumulator
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getIntCounter
public org.apache.flink.api.common.accumulators.IntCounter getIntCounter(String name)
- Specified by:
getIntCounter
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getLongCounter
public org.apache.flink.api.common.accumulators.LongCounter getLongCounter(String name)
- Specified by:
getLongCounter
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getDoubleCounter
public org.apache.flink.api.common.accumulators.DoubleCounter getDoubleCounter(String name)
- Specified by:
getDoubleCounter
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getHistogram
public org.apache.flink.api.common.accumulators.Histogram getHistogram(String name)
- Specified by:
getHistogram
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getExternalResourceInfos
public Set<org.apache.flink.api.common.externalresource.ExternalResourceInfo> getExternalResourceInfos(String resourceName)
- Specified by:
getExternalResourceInfos
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
hasBroadcastVariable
public boolean hasBroadcastVariable(String name)
- Specified by:
hasBroadcastVariable
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getBroadcastVariable
public <RT> List<RT> getBroadcastVariable(String name)
- Specified by:
getBroadcastVariable
in 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:
getBroadcastVariableWithInitializer
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getDistributedCache
public org.apache.flink.api.common.cache.DistributedCache getDistributedCache()
- Specified by:
getDistributedCache
in 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:
getState
in 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:
getListState
in 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:
getReducingState
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getAggregatingState
public <IN,ACC,OUT> org.apache.flink.api.common.state.AggregatingState<IN,OUT> getAggregatingState(org.apache.flink.api.common.state.AggregatingStateDescriptor<IN,ACC,OUT> stateProperties)
- Specified by:
getAggregatingState
in 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:
getMapState
in 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:
getState
in 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:
getListState
in 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:
getReducingState
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getAggregatingState
public <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)
- Specified by:
getAggregatingState
in 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:
getMapState
in interfaceorg.apache.flink.api.common.functions.RuntimeContext
-
getStateDescriptors
public List<org.apache.flink.api.common.state.StateDescriptor<?,?>> getStateDescriptors()
-
-