Class BroadcastVariableManager

java.lang.Object
org.apache.flink.runtime.broadcast.BroadcastVariableManager

public class BroadcastVariableManager extends Object
The BroadcastVariableManager is used to manage the materialization of broadcast variables. References to materialized broadcast variables are cached and shared between parallel subtasks. A reference count is maintained to track whether the materialization may be cleaned up.
  • Constructor Details

    • BroadcastVariableManager

      public BroadcastVariableManager()
  • Method Details

    • materializeBroadcastVariable

      public <T> BroadcastVariableMaterialization<T,?> materializeBroadcastVariable(String name, int superstep, BatchTask<?,?> holder, MutableReader<?> reader, org.apache.flink.api.common.typeutils.TypeSerializerFactory<T> serializerFactory) throws IOException
      Materializes the broadcast variable for the given name, scoped to the given task and its iteration superstep. An existing materialization created by another parallel subtask may be returned, if it hasn't expired yet.
      Throws:
      IOException
    • releaseReference

      public void releaseReference(String name, int superstep, BatchTask<?,?> referenceHolder)
    • releaseReference

      public void releaseReference(BroadcastVariableKey key, BatchTask<?,?> referenceHolder)
    • releaseAllReferencesFromTask

      public void releaseAllReferencesFromTask(BatchTask<?,?> referenceHolder)
    • getNumberOfVariablesWithReferences

      public int getNumberOfVariablesWithReferences()