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 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:
      getJobInfo in interface org.apache.flink.api.common.functions.RuntimeContext
    • getTaskInfo

      public org.apache.flink.api.common.TaskInfo getTaskInfo()
      Specified by:
      getTaskInfo in interface org.apache.flink.api.common.functions.RuntimeContext
    • getMetricGroup

      public org.apache.flink.metrics.groups.OperatorMetricGroup getMetricGroup()
      Specified by:
      getMetricGroup in interface org.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 interface org.apache.flink.api.common.functions.RuntimeContext
    • getGlobalJobParameters

      public Map<String,String> getGlobalJobParameters()
      Specified by:
      getGlobalJobParameters in interface org.apache.flink.api.common.functions.RuntimeContext
    • isObjectReuseEnabled

      public boolean isObjectReuseEnabled()
      Specified by:
      isObjectReuseEnabled in interface org.apache.flink.api.common.functions.RuntimeContext
    • getUserCodeClassLoader

      public ClassLoader getUserCodeClassLoader()
      Specified by:
      getUserCodeClassLoader in interface org.apache.flink.api.common.functions.RuntimeContext
    • registerUserCodeClassLoaderReleaseHookIfAbsent

      public void registerUserCodeClassLoaderReleaseHookIfAbsent(String releaseHookName, Runnable releaseHook)
      Specified by:
      registerUserCodeClassLoaderReleaseHookIfAbsent in interface org.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 interface org.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 interface org.apache.flink.api.common.functions.RuntimeContext
    • getIntCounter

      public org.apache.flink.api.common.accumulators.IntCounter getIntCounter(String name)
      Specified by:
      getIntCounter in interface org.apache.flink.api.common.functions.RuntimeContext
    • getLongCounter

      public org.apache.flink.api.common.accumulators.LongCounter getLongCounter(String name)
      Specified by:
      getLongCounter in interface org.apache.flink.api.common.functions.RuntimeContext
    • getDoubleCounter

      public org.apache.flink.api.common.accumulators.DoubleCounter getDoubleCounter(String name)
      Specified by:
      getDoubleCounter in interface org.apache.flink.api.common.functions.RuntimeContext
    • getHistogram

      public org.apache.flink.api.common.accumulators.Histogram getHistogram(String name)
      Specified by:
      getHistogram in interface org.apache.flink.api.common.functions.RuntimeContext
    • getExternalResourceInfos

      public Set<org.apache.flink.api.common.externalresource.ExternalResourceInfo> getExternalResourceInfos(String resourceName)
      Specified by:
      getExternalResourceInfos in interface org.apache.flink.api.common.functions.RuntimeContext
    • hasBroadcastVariable

      public boolean hasBroadcastVariable(String name)
      Specified by:
      hasBroadcastVariable in interface org.apache.flink.api.common.functions.RuntimeContext
    • getBroadcastVariable

      public <RT> List<RT> getBroadcastVariable(String name)
      Specified by:
      getBroadcastVariable in interface org.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 interface org.apache.flink.api.common.functions.RuntimeContext
    • getDistributedCache

      public org.apache.flink.api.common.cache.DistributedCache getDistributedCache()
      Specified by:
      getDistributedCache in interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.apache.flink.api.common.functions.RuntimeContext
    • getStateDescriptors

      public List<org.apache.flink.api.common.state.StateDescriptor<?,?>> getStateDescriptors()
    • disableStateRegistration

      public void disableStateRegistration() throws Exception
      Throws:
      Exception