public class JobWorker extends Object implements Serializable
JobMaster through ray api, and JobMaster communicates with JobWorker through Ray.call().
The JobWorker is responsible for creating tasks and defines the methods of communication between workers.
| Modifier and Type | Field and Description |
|---|---|
ContextBackend |
contextBackend |
Object |
initialStateChangeLock |
AtomicBoolean |
isRecreate
isRecreate=true means this worker is initialized more than once after actor created.
|
| Constructor and Description |
|---|
JobWorker(ExecutionVertex executionVertex) |
| Modifier and Type | Method and Description |
|---|---|
Boolean |
checkIfNeedRollback(Long startCallTs) |
Boolean |
clearExpiredCheckpoint(Long expiredStateCpId,
Long expiredQueueCpId) |
ExecutionVertex |
getExecutionVertex() |
StreamTask |
getTask() |
StreamingWorkerConfig |
getWorkerConfig() |
JobWorkerContext |
getWorkerContext() |
Boolean |
init(JobWorkerContext workerContext)
Initialize JobWorker and data communication pipeline.
|
Boolean |
notifyCheckpointTimeout(Long checkpointId) |
void |
onReaderMessage(byte[] buffer)
Used by upstream streaming queue to send data to this actor
|
byte[] |
onReaderMessageSync(byte[] buffer)
Used by upstream streaming queue to send data to this actor and receive result from this actor
|
void |
onWriterMessage(byte[] buffer)
Used by downstream streaming queue to send data to this actor
|
byte[] |
onWriterMessageSync(byte[] buffer)
Used by downstream streaming queue to send data to this actor and receive result from this
actor
|
void |
requestRollback(String exceptionMsg) |
CallResult<ChannelRecoverInfo> |
rollback(Long checkpointId,
Long startRollbackTs)
Start worker's stream tasks with specific checkpoint ID.
|
void |
saveContext() |
Boolean |
triggerCheckpoint(Long barrierId)
Trigger source job worker checkpoint
|
public final Object initialStateChangeLock
public AtomicBoolean isRecreate
public ContextBackend contextBackend
public JobWorker(ExecutionVertex executionVertex)
public void saveContext()
public Boolean init(JobWorkerContext workerContext)
public CallResult<ChannelRecoverInfo> rollback(Long checkpointId, Long startRollbackTs)
CallResult with ChannelRecoverInfo, contains ChannelRecoverInfo.ChannelCreationStatus of each input queue.public Boolean triggerCheckpoint(Long barrierId)
public Boolean clearExpiredCheckpoint(Long expiredStateCpId, Long expiredQueueCpId)
public void requestRollback(String exceptionMsg)
public StreamingWorkerConfig getWorkerConfig()
public JobWorkerContext getWorkerContext()
public ExecutionVertex getExecutionVertex()
public StreamTask getTask()
public void onReaderMessage(byte[] buffer)
public byte[] onReaderMessageSync(byte[] buffer)
public void onWriterMessage(byte[] buffer)
public byte[] onWriterMessageSync(byte[] buffer)
Copyright © 2021. All rights reserved.