public class DistributedRuntimeUDFContext extends AbstractRuntimeUDFContext
RuntimeContext
, created by runtime UDF operators.Constructor and Description |
---|
DistributedRuntimeUDFContext(TaskInfo taskInfo,
ClassLoader userCodeClassLoader,
ExecutionConfig executionConfig,
Map<String,Future<Path>> cpTasks,
Map<String,Accumulator<?,?>> accumulators,
MetricGroup metrics) |
Modifier and Type | Method and Description |
---|---|
void |
clearAllBroadcastVariables() |
void |
clearBroadcastVariable(String name) |
<T> List<T> |
getBroadcastVariable(String name)
Returns the result bound to the broadcast variable identified by the
given
name . |
<T,C> C |
getBroadcastVariableWithInitializer(String name,
BroadcastVariableInitializer<T,C> initializer)
Returns the result bound to the broadcast variable identified by the
given
name . |
boolean |
hasBroadcastVariable(String name)
Tests for the existence of the broadcast variable identified by the
given
name . |
void |
setBroadcastVariable(String name,
BroadcastVariableMaterialization<?,?> value) |
addAccumulator, getAccumulator, getAggregatingState, getAllAccumulators, getAllocationIDAsString, getAttemptNumber, getDistributedCache, getDoubleCounter, getExecutionConfig, getFoldingState, getHistogram, getIndexOfThisSubtask, getIntCounter, getListState, getLongCounter, getMapState, getMaxNumberOfParallelSubtasks, getMetricGroup, getNumberOfParallelSubtasks, getReducingState, getState, getTaskName, getTaskNameWithSubtasks, getUserCodeClassLoader
public DistributedRuntimeUDFContext(TaskInfo taskInfo, ClassLoader userCodeClassLoader, ExecutionConfig executionConfig, Map<String,Future<Path>> cpTasks, Map<String,Accumulator<?,?>> accumulators, MetricGroup metrics)
public boolean hasBroadcastVariable(String name)
RuntimeContext
name
.name
- The name under which the broadcast variable is registered;public <T> List<T> getBroadcastVariable(String name)
RuntimeContext
name
.
IMPORTANT: The broadcast variable data structure is shared between the parallel tasks on one machine. Any access that modifies its internal state needs to be manually synchronized by the caller.
name
- The name under which the broadcast variable is registered;public <T,C> C getBroadcastVariableWithInitializer(String name, BroadcastVariableInitializer<T,C> initializer)
RuntimeContext
name
. The broadcast variable is returned as a shared data structure
that is initialized with the given BroadcastVariableInitializer
.
IMPORTANT: The broadcast variable data structure is shared between the parallel tasks on one machine. Any access that modifies its internal state needs to be manually synchronized by the caller.
name
- The name under which the broadcast variable is registered;initializer
- The initializer that creates the shared data structure of the broadcast
variable from the sequence of elements.public void setBroadcastVariable(String name, BroadcastVariableMaterialization<?,?> value)
public void clearBroadcastVariable(String name)
public void clearAllBroadcastVariables()
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.