@Internal public class RuntimeUDFContext extends AbstractRuntimeUDFContext
RuntimeContext
, created by runtime UDF operators.Constructor and Description |
---|
RuntimeUDFContext(TaskInfo taskInfo,
ClassLoader userCodeClassLoader,
ExecutionConfig executionConfig,
Map<String,Future<Path>> cpTasks,
Map<String,Accumulator<?,?>> accumulators) |
Modifier and Type | Method and Description |
---|---|
void |
clearAllBroadcastVariables() |
void |
clearBroadcastVariable(String name) |
<RT> List<RT> |
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 . |
void |
setBroadcastVariable(String name,
List<?> value) |
addAccumulator, getAccumulator, getAllAccumulators, getAttemptNumber, getDistributedCache, getDoubleCounter, getExecutionConfig, getHistogram, getIndexOfThisSubtask, getIntCounter, getKeyValueState, getKeyValueState, getListState, getLongCounter, getNumberOfParallelSubtasks, getReducingState, getState, getTaskName, getTaskNameWithSubtasks, getUserCodeClassLoader
public RuntimeUDFContext(TaskInfo taskInfo, ClassLoader userCodeClassLoader, ExecutionConfig executionConfig, Map<String,Future<Path>> cpTasks, Map<String,Accumulator<?,?>> accumulators)
public <RT> List<RT> 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 clearBroadcastVariable(String name)
public void clearAllBroadcastVariables()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.