public class RuntimeEnvironment extends Object implements Environment
Environment
.Constructor and Description |
---|
RuntimeEnvironment(org.apache.flink.api.common.JobID jobId,
JobVertexID jobVertexId,
ExecutionAttemptID executionId,
String taskName,
String taskNameWithSubtasks,
int subtaskIndex,
int parallelism,
org.apache.flink.configuration.Configuration jobConfiguration,
org.apache.flink.configuration.Configuration taskConfiguration,
ClassLoader userCodeClassLoader,
MemoryManager memManager,
IOManager ioManager,
BroadcastVariableManager bcVarManager,
AccumulatorRegistry accumulatorRegistry,
InputSplitProvider splitProvider,
Map<String,Future<org.apache.flink.core.fs.Path>> distCacheEntries,
ResultPartitionWriter[] writers,
InputGate[] inputGates,
ActorGateway jobManager,
TaskManagerRuntimeInfo taskManagerInfo) |
Modifier and Type | Method and Description |
---|---|
void |
acknowledgeCheckpoint(long checkpointId)
Confirms that the invokable has successfully completed all steps it needed to
to for the checkpoint with the give checkpoint-ID.
|
void |
acknowledgeCheckpoint(long checkpointId,
StateHandle<?> state)
Confirms that the invokable has successfully completed all steps it needed to
to for the checkpoint with the give checkpoint-ID.
|
AccumulatorRegistry |
getAccumulatorRegistry()
Return the registry for accumulators which are periodically sent to the job manager.
|
InputGate[] |
getAllInputGates() |
ResultPartitionWriter[] |
getAllWriters() |
BroadcastVariableManager |
getBroadcastVariableManager() |
Map<String,Future<org.apache.flink.core.fs.Path>> |
getDistributedCacheEntries() |
ExecutionAttemptID |
getExecutionId()
Gets the ID of the task execution attempt.
|
int |
getIndexInSubtaskGroup()
Returns the index of this subtask in the subtask group.
|
InputGate |
getInputGate(int index) |
InputSplitProvider |
getInputSplitProvider()
Returns the input split provider assigned to this environment.
|
IOManager |
getIOManager()
Returns the current
IOManager . |
org.apache.flink.configuration.Configuration |
getJobConfiguration()
Returns the job-wide configuration object that was attached to the JobGraph.
|
org.apache.flink.api.common.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.
|
MemoryManager |
getMemoryManager()
Returns the current
MemoryManager . |
int |
getNumberOfSubtasks()
Returns the current number of subtasks the respective task is split into.
|
org.apache.flink.configuration.Configuration |
getTaskConfiguration()
Returns the task-wide configuration object, originally attache to the job vertex.
|
TaskManagerRuntimeInfo |
getTaskManagerInfo()
Gets the task manager info, with configuration and hostname.
|
String |
getTaskName()
Returns the name of the task running in this environment.
|
String |
getTaskNameWithSubtasks()
Returns the name of the task running in this environment, appended
with the subtask indicator, such as "MyTask (3/6)", where
3 would be (
Environment.getIndexInSubtaskGroup() + 1), and 6 would be
Environment.getNumberOfSubtasks() . |
ClassLoader |
getUserClassLoader()
Returns the user code class loader
|
ResultPartitionWriter |
getWriter(int index) |
public RuntimeEnvironment(org.apache.flink.api.common.JobID jobId, JobVertexID jobVertexId, ExecutionAttemptID executionId, String taskName, String taskNameWithSubtasks, int subtaskIndex, int parallelism, org.apache.flink.configuration.Configuration jobConfiguration, org.apache.flink.configuration.Configuration taskConfiguration, ClassLoader userCodeClassLoader, MemoryManager memManager, IOManager ioManager, BroadcastVariableManager bcVarManager, AccumulatorRegistry accumulatorRegistry, InputSplitProvider splitProvider, Map<String,Future<org.apache.flink.core.fs.Path>> distCacheEntries, ResultPartitionWriter[] writers, InputGate[] inputGates, ActorGateway jobManager, TaskManagerRuntimeInfo taskManagerInfo)
public org.apache.flink.api.common.JobID getJobID()
Environment
getJobID
in interface Environment
public JobVertexID getJobVertexId()
Environment
getJobVertexId
in interface Environment
public ExecutionAttemptID getExecutionId()
Environment
getExecutionId
in interface Environment
public String getTaskName()
Environment
getTaskName
in interface Environment
public String getTaskNameWithSubtasks()
Environment
Environment.getIndexInSubtaskGroup()
+ 1), and 6 would be
Environment.getNumberOfSubtasks()
.getTaskNameWithSubtasks
in interface Environment
public int getNumberOfSubtasks()
Environment
getNumberOfSubtasks
in interface Environment
public int getIndexInSubtaskGroup()
Environment
Environment.getNumberOfSubtasks()
- 1.getIndexInSubtaskGroup
in interface Environment
public org.apache.flink.configuration.Configuration getJobConfiguration()
Environment
getJobConfiguration
in interface Environment
public org.apache.flink.configuration.Configuration getTaskConfiguration()
Environment
getTaskConfiguration
in interface Environment
public TaskManagerRuntimeInfo getTaskManagerInfo()
Environment
getTaskManagerInfo
in interface Environment
public ClassLoader getUserClassLoader()
Environment
getUserClassLoader
in interface Environment
public MemoryManager getMemoryManager()
Environment
MemoryManager
.getMemoryManager
in interface Environment
MemoryManager
.public IOManager getIOManager()
Environment
IOManager
.getIOManager
in interface Environment
IOManager
.public BroadcastVariableManager getBroadcastVariableManager()
getBroadcastVariableManager
in interface Environment
public AccumulatorRegistry getAccumulatorRegistry()
Environment
getAccumulatorRegistry
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<org.apache.flink.core.fs.Path>> getDistributedCacheEntries()
getDistributedCacheEntries
in interface Environment
public ResultPartitionWriter getWriter(int index)
getWriter
in interface Environment
public ResultPartitionWriter[] getAllWriters()
getAllWriters
in interface Environment
public InputGate getInputGate(int index)
getInputGate
in interface Environment
public InputGate[] getAllInputGates()
getAllInputGates
in interface Environment
public void acknowledgeCheckpoint(long checkpointId)
Environment
acknowledgeCheckpoint
in interface Environment
checkpointId
- The ID of the checkpoint.public void acknowledgeCheckpoint(long checkpointId, StateHandle<?> state)
Environment
acknowledgeCheckpoint
in interface Environment
checkpointId
- The ID of the checkpoint.state
- A handle to the state to be included in the checkpoint.Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.