@NotThreadSafe public final class BlockMasterSync extends Object implements HeartbeatExecutor
BlockMasterClient
.
When running, this task first requests a block report from the
BlockWorker
, then sends it to the master. The master may
respond to the heartbeat with a command which will be executed. After which, the task will wait
for the elapsed time since its last heartbeat has reached the heartbeat interval. Then the cycle
will continue.
If the task fails to heartbeat to the master, it will destroy its old master client and recreate
it before retrying.Constructor and Description |
---|
BlockMasterSync(BlockWorker blockWorker,
AtomicReference<Long> workerId,
WorkerNetAddress workerAddress,
BlockMasterClientPool masterClientPool)
Creates a new instance of
BlockMasterSync . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Cleans up any resources used by the heartbeat executor.
|
void |
heartbeat()
Heartbeats to the master node about the change in the worker's managed space.
|
public BlockMasterSync(BlockWorker blockWorker, AtomicReference<Long> workerId, WorkerNetAddress workerAddress, BlockMasterClientPool masterClientPool) throws IOException
BlockMasterSync
.blockWorker
- the BlockWorker
this syncer is updating toworkerId
- the worker id of the worker, assigned by the block masterworkerAddress
- the net address of the workermasterClientPool
- the Alluxio master client poolIOException
public void heartbeat()
heartbeat
in interface HeartbeatExecutor
public void close()
HeartbeatExecutor
close
in interface HeartbeatExecutor
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2023. All Rights Reserved.