@NotThreadSafe public final class JobWorkerIdRegistry extends Object
Modifier and Type | Field and Description |
---|---|
static long |
INVALID_WORKER_ID
The default value to initialize job worker id, the job worker id generated by job master will
never be the same as this value.
|
Modifier and Type | Method and Description |
---|---|
static Long |
getWorkerId() |
static void |
registerWorker(JobMasterClient jobMasterClient,
WorkerNetAddress workerAddress)
Registers with
JobMaster to get a new job worker id. |
public static final long INVALID_WORKER_ID
public static void registerWorker(JobMasterClient jobMasterClient, WorkerNetAddress workerAddress) throws IOException, ConnectionFailedException
JobMaster
to get a new job worker id.jobMasterClient
- the job master client to be used for RPCworkerAddress
- current worker addressIOException
- when fails to get a new worker idConnectionFailedException
- if network connection failedpublic static Long getWorkerId()
Copyright © 2023. All Rights Reserved.