public class RuntimeEnvironment extends Object implements Environment
Environment
.Constructor and Description |
---|
RuntimeEnvironment(JobID jobId,
JobVertexID jobVertexId,
ExecutionAttemptID executionId,
ExecutionConfig executionConfig,
TaskInfo taskInfo,
Configuration jobConfiguration,
Configuration taskConfiguration,
UserCodeClassLoader userCodeClassLoader,
MemoryManager memManager,
SharedResources sharedResources,
IOManager ioManager,
BroadcastVariableManager bcVarManager,
TaskStateManager taskStateManager,
GlobalAggregateManager aggregateManager,
AccumulatorRegistry accumulatorRegistry,
TaskKvStateRegistry kvStateRegistry,
InputSplitProvider splitProvider,
Map<String,Future<Path>> distCacheEntries,
ResultPartitionWriter[] writers,
IndexedInputGate[] inputGates,
TaskEventDispatcher taskEventDispatcher,
CheckpointResponder checkpointResponder,
TaskOperatorEventGateway operatorEventGateway,
TaskManagerRuntimeInfo taskManagerInfo,
TaskMetricGroup metrics,
Task containingTask,
ExternalResourceInfoProvider externalResourceInfoProvider,
ChannelStateWriteRequestExecutorFactory channelStateExecutorFactory,
TaskManagerActions taskManagerActions) |
Modifier and Type | Method and Description |
---|---|
void |
acknowledgeCheckpoint(long checkpointId,
CheckpointMetrics checkpointMetrics)
Confirms that the invokable has successfully completed all steps it needed to for the
checkpoint with the give checkpoint-ID.
|
void |
acknowledgeCheckpoint(long checkpointId,
CheckpointMetrics checkpointMetrics,
TaskStateSnapshot checkpointStateHandles)
Confirms that the invokable has successfully completed all required steps for the checkpoint
with the give checkpoint-ID.
|
void |
declineCheckpoint(long checkpointId,
CheckpointException checkpointException)
Declines a checkpoint.
|
void |
failExternally(Throwable cause)
Marks task execution failed for an external reason (a reason other than the task code itself
throwing an exception).
|
AccumulatorRegistry |
getAccumulatorRegistry()
Return the registry for accumulators which are periodically sent to the job manager.
|
IndexedInputGate[] |
getAllInputGates() |
ResultPartitionWriter[] |
getAllWriters() |
ExecutorService |
getAsyncOperationsThreadPool() |
BroadcastVariableManager |
getBroadcastVariableManager() |
ChannelStateWriteRequestExecutorFactory |
getChannelStateExecutorFactory() |
CheckpointStorageAccess |
getCheckpointStorageAccess() |
Map<String,Future<Path>> |
getDistributedCacheEntries() |
ExecutionConfig |
getExecutionConfig()
Returns the job specific
ExecutionConfig . |
ExecutionAttemptID |
getExecutionId()
Gets the ID of the task execution attempt.
|
ExternalResourceInfoProvider |
getExternalResourceInfoProvider()
Get the
ExternalResourceInfoProvider which contains infos of available external
resources. |
GlobalAggregateManager |
getGlobalAggregateManager() |
IndexedInputGate |
getInputGate(int index) |
InputSplitProvider |
getInputSplitProvider()
Returns the input split provider assigned to this environment.
|
IOManager |
getIOManager()
Returns the current
IOManager . |
Configuration |
getJobConfiguration()
Returns the job-wide configuration object that was attached to the JobGraph.
|
JobID |
getJobID()
Returns the ID of the job that the task belongs to.
|
JobVertexID |
getJobVertexId()
Gets the ID of the JobVertex for which this task executes a parallel subtask.
|
MailboxExecutor |
getMainMailboxExecutor() |
MemoryManager |
getMemoryManager()
Returns the current
MemoryManager . |
TaskMetricGroup |
getMetricGroup()
Returns the task specific metric group.
|
TaskOperatorEventGateway |
getOperatorCoordinatorEventGateway()
Gets the gateway through which operators can send events to the operator coordinators.
|
SharedResources |
getSharedResources() |
Configuration |
getTaskConfiguration()
Returns the task-wide configuration object, originally attached to the job vertex.
|
TaskEventDispatcher |
getTaskEventDispatcher() |
TaskInfo |
getTaskInfo()
Returns the
TaskInfo object associated with this subtask |
TaskKvStateRegistry |
getTaskKvStateRegistry()
Returns the registry for
InternalKvState instances. |
TaskManagerActions |
getTaskManagerActions() |
TaskManagerRuntimeInfo |
getTaskManagerInfo()
Gets the task manager info, with configuration and hostname.
|
TaskStateManager |
getTaskStateManager() |
UserCodeClassLoader |
getUserCodeClassLoader()
Returns the user code class loader
|
ResultPartitionWriter |
getWriter(int index) |
void |
setAsyncOperationsThreadPool(ExecutorService executorService) |
void |
setCheckpointStorageAccess(CheckpointStorageAccess checkpointStorageAccess) |
void |
setMainMailboxExecutor(MailboxExecutor mainMailboxExecutor) |
public RuntimeEnvironment(JobID jobId, JobVertexID jobVertexId, ExecutionAttemptID executionId, ExecutionConfig executionConfig, TaskInfo taskInfo, Configuration jobConfiguration, Configuration taskConfiguration, UserCodeClassLoader userCodeClassLoader, MemoryManager memManager, SharedResources sharedResources, IOManager ioManager, BroadcastVariableManager bcVarManager, TaskStateManager taskStateManager, GlobalAggregateManager aggregateManager, AccumulatorRegistry accumulatorRegistry, TaskKvStateRegistry kvStateRegistry, InputSplitProvider splitProvider, Map<String,Future<Path>> distCacheEntries, ResultPartitionWriter[] writers, IndexedInputGate[] inputGates, TaskEventDispatcher taskEventDispatcher, CheckpointResponder checkpointResponder, TaskOperatorEventGateway operatorEventGateway, TaskManagerRuntimeInfo taskManagerInfo, TaskMetricGroup metrics, Task containingTask, ExternalResourceInfoProvider externalResourceInfoProvider, ChannelStateWriteRequestExecutorFactory channelStateExecutorFactory, TaskManagerActions taskManagerActions)
public ExecutionConfig getExecutionConfig()
Environment
ExecutionConfig
.getExecutionConfig
in interface Environment
public JobID getJobID()
Environment
getJobID
in interface Environment
public JobVertexID getJobVertexId()
Environment
getJobVertexId
in interface Environment
public ExecutionAttemptID getExecutionId()
Environment
getExecutionId
in interface Environment
public TaskInfo getTaskInfo()
Environment
TaskInfo
object associated with this subtaskgetTaskInfo
in interface Environment
public Configuration getJobConfiguration()
Environment
getJobConfiguration
in interface Environment
public Configuration getTaskConfiguration()
Environment
getTaskConfiguration
in interface Environment
public TaskManagerRuntimeInfo getTaskManagerInfo()
Environment
getTaskManagerInfo
in interface Environment
public TaskMetricGroup getMetricGroup()
Environment
getMetricGroup
in interface Environment
public UserCodeClassLoader getUserCodeClassLoader()
Environment
getUserCodeClassLoader
in interface Environment
public MemoryManager getMemoryManager()
Environment
MemoryManager
.getMemoryManager
in interface Environment
MemoryManager
.public SharedResources getSharedResources()
getSharedResources
in interface Environment
public IOManager getIOManager()
Environment
IOManager
.getIOManager
in interface Environment
IOManager
.public BroadcastVariableManager getBroadcastVariableManager()
getBroadcastVariableManager
in interface Environment
public TaskStateManager getTaskStateManager()
getTaskStateManager
in interface Environment
public GlobalAggregateManager getGlobalAggregateManager()
getGlobalAggregateManager
in interface Environment
public AccumulatorRegistry getAccumulatorRegistry()
Environment
getAccumulatorRegistry
in interface Environment
public TaskKvStateRegistry getTaskKvStateRegistry()
Environment
InternalKvState
instances.getTaskKvStateRegistry
in interface Environment
public InputSplitProvider getInputSplitProvider()
Environment
getInputSplitProvider
in interface Environment
null
if no such provider has been assigned to
this environment.public Map<String,Future<Path>> getDistributedCacheEntries()
getDistributedCacheEntries
in interface Environment
public ResultPartitionWriter getWriter(int index)
getWriter
in interface Environment
public ResultPartitionWriter[] getAllWriters()
getAllWriters
in interface Environment
public IndexedInputGate getInputGate(int index)
getInputGate
in interface Environment
public IndexedInputGate[] getAllInputGates()
getAllInputGates
in interface Environment
public TaskEventDispatcher getTaskEventDispatcher()
getTaskEventDispatcher
in interface Environment
public ExternalResourceInfoProvider getExternalResourceInfoProvider()
Environment
ExternalResourceInfoProvider
which contains infos of available external
resources.getExternalResourceInfoProvider
in interface Environment
ExternalResourceInfoProvider
which contains infos of available external
resourcespublic TaskManagerActions getTaskManagerActions()
getTaskManagerActions
in interface Environment
public void acknowledgeCheckpoint(long checkpointId, CheckpointMetrics checkpointMetrics)
Environment
acknowledgeCheckpoint
in interface Environment
checkpointId
- ID of this checkpointcheckpointMetrics
- metrics for this checkpointpublic void acknowledgeCheckpoint(long checkpointId, CheckpointMetrics checkpointMetrics, TaskStateSnapshot checkpointStateHandles)
Environment
acknowledgeCheckpoint
in interface Environment
checkpointId
- ID of this checkpointcheckpointMetrics
- metrics for this checkpointcheckpointStateHandles
- All state handles for the checkpointed statepublic void declineCheckpoint(long checkpointId, CheckpointException checkpointException)
Environment
declineCheckpoint
in interface Environment
checkpointId
- The ID of the declined checkpoint.checkpointException
- The exception why the checkpoint was declined.public TaskOperatorEventGateway getOperatorCoordinatorEventGateway()
Environment
getOperatorCoordinatorEventGateway
in interface Environment
public void failExternally(Throwable cause)
Environment
This method never blocks.
failExternally
in interface Environment
public void setMainMailboxExecutor(MailboxExecutor mainMailboxExecutor)
setMainMailboxExecutor
in interface Environment
public MailboxExecutor getMainMailboxExecutor()
getMainMailboxExecutor
in interface Environment
public void setAsyncOperationsThreadPool(ExecutorService executorService)
setAsyncOperationsThreadPool
in interface Environment
public ExecutorService getAsyncOperationsThreadPool()
getAsyncOperationsThreadPool
in interface Environment
public void setCheckpointStorageAccess(CheckpointStorageAccess checkpointStorageAccess)
setCheckpointStorageAccess
in interface Environment
public CheckpointStorageAccess getCheckpointStorageAccess()
getCheckpointStorageAccess
in interface Environment
public ChannelStateWriteRequestExecutorFactory getChannelStateExecutorFactory()
getChannelStateExecutorFactory
in interface Environment
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.