public class DistributedRuntimeUDFContext extends AbstractRuntimeUDFContext
RuntimeContext
, created by runtime UDF operators.Constructor and Description |
---|
DistributedRuntimeUDFContext(JobInfo jobInfo,
TaskInfo taskInfo,
UserCodeClassLoader userCodeClassLoader,
ExecutionConfig executionConfig,
Map<String,Future<Path>> cpTasks,
Map<String,Accumulator<?,?>> accumulators,
OperatorMetricGroup metrics,
ExternalResourceInfoProvider externalResourceInfoProvider) |
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 . |
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,
BroadcastVariableMaterialization<?,?> 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
public DistributedRuntimeUDFContext(JobInfo jobInfo, TaskInfo taskInfo, UserCodeClassLoader userCodeClassLoader, ExecutionConfig executionConfig, Map<String,Future<Path>> cpTasks, Map<String,Accumulator<?,?>> accumulators, OperatorMetricGroup metrics, ExternalResourceInfoProvider externalResourceInfoProvider)
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 Set<ExternalResourceInfo> getExternalResourceInfos(String resourceName)
RuntimeContext
resourceName
- of the required external resourcepublic void setBroadcastVariable(String name, BroadcastVariableMaterialization<?,?> value)
public void clearBroadcastVariable(String name)
public void clearAllBroadcastVariables()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.