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 Summary
Constructors Constructor Description BroadcastVariableManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNumberOfVariablesWithReferences()
<T> BroadcastVariableMaterialization<T,?>
materializeBroadcastVariable(String name, int superstep, BatchTask<?,?> holder, MutableReader<?> reader, TypeSerializerFactory<T> serializerFactory)
Materializes the broadcast variable for the given name, scoped to the given task and its iteration superstep.void
releaseAllReferencesFromTask(BatchTask<?,?> referenceHolder)
void
releaseReference(String name, int superstep, BatchTask<?,?> referenceHolder)
void
releaseReference(BroadcastVariableKey key, BatchTask<?,?> referenceHolder)
-
-
-
Method Detail
-
materializeBroadcastVariable
public <T> BroadcastVariableMaterialization<T,?> materializeBroadcastVariable(String name, int superstep, BatchTask<?,?> holder, MutableReader<?> reader, 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()
-
-