@Internal public class RuntimeUDFContext extends AbstractRuntimeUDFContext
RuntimeContext
, created by runtime UDF operators. Used
mostly in CollectionExecutor and can be removed along with the DataSet API.Constructor and Description |
---|
RuntimeUDFContext(JobInfo jobInfo,
TaskInfo taskInfo,
ClassLoader userCodeClassLoader,
ExecutionConfig executionConfig,
Map<String,Future<Path>> cpTasks,
Map<String,Accumulator<?,?>> accumulators,
OperatorMetricGroup metrics) |
RuntimeUDFContext(TaskInfo taskInfo,
ClassLoader userCodeClassLoader,
ExecutionConfig executionConfig,
Map<String,Future<Path>> cpTasks,
Map<String,Accumulator<?,?>> accumulators,
OperatorMetricGroup metrics) |
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 . |
Set<ExternalResourceInfo> |
getExternalResourceInfos(String resourceName)
Get the specific external resource information by the resourceName.
|
boolean |
hasBroadcastVariable(String name)
Tests for the existence of the broadcast variable identified by the given
name . |
void |
setBroadcastVariable(String name,
List<?> value) |
addAccumulator, createSerializer, getAccumulator, getAggregatingState, getAllocationIDAsString, getDistributedCache, getDoubleCounter, getExecutionConfig, getGlobalJobParameters, getHistogram, getIntCounter, getJobInfo, getListState, getLongCounter, getMapState, getMetricGroup, getReducingState, getState, getTaskInfo, getUserCodeClassLoader, isObjectReuseEnabled, registerUserCodeClassLoaderReleaseHookIfAbsent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttemptNumber, getIndexOfThisSubtask, getJobId, getMaxNumberOfParallelSubtasks, getNumberOfParallelSubtasks, getTaskName, getTaskNameWithSubtasks
@VisibleForTesting public RuntimeUDFContext(TaskInfo taskInfo, ClassLoader userCodeClassLoader, ExecutionConfig executionConfig, Map<String,Future<Path>> cpTasks, Map<String,Accumulator<?,?>> accumulators, OperatorMetricGroup metrics)
public RuntimeUDFContext(JobInfo jobInfo, TaskInfo taskInfo, ClassLoader userCodeClassLoader, ExecutionConfig executionConfig, Map<String,Future<Path>> cpTasks, Map<String,Accumulator<?,?>> accumulators, OperatorMetricGroup metrics)
public boolean hasBroadcastVariable(String name)
RuntimeContext
name
.name
- The name under which the broadcast variable is registered;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 Set<ExternalResourceInfo> getExternalResourceInfos(String resourceName)
RuntimeContext
resourceName
- of the required external resourcepublic void clearBroadcastVariable(String name)
public void clearAllBroadcastVariables()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.