@NotThreadSafe public final class TestSpecificMasterBlockSync extends SpecificMasterBlockSync
SpecificMasterBlockSync
that adds some interfaces for testing.SpecificMasterBlockSync.Metrics
Constructor and Description |
---|
TestSpecificMasterBlockSync(BlockWorker blockWorker,
BlockMasterClient masterClient,
BlockHeartbeatReporter heartbeatReporter)
Creates a new instance of
SpecificMasterBlockSync . |
Modifier and Type | Method and Description |
---|---|
protected void |
beforeHeartbeat() |
void |
failHeartbeat()
Fails the heartbeat and lets it throws an exception.
|
int |
getRegistrationSuccessCount() |
protected void |
registerWithMasterInternal() |
void |
restoreHeartbeat()
Restores the heartbeat.
|
close, heartbeat, isRegistered
public TestSpecificMasterBlockSync(BlockWorker blockWorker, BlockMasterClient masterClient, BlockHeartbeatReporter heartbeatReporter) throws IOException
SpecificMasterBlockSync
.blockWorker
- the BlockWorker
this syncer is updating tomasterClient
- the block master clientheartbeatReporter
- the heartbeat reporterIOException
public void restoreHeartbeat()
public void failHeartbeat()
public int getRegistrationSuccessCount()
protected void registerWithMasterInternal() throws IOException, FailedToAcquireRegisterLeaseException
registerWithMasterInternal
in class SpecificMasterBlockSync
IOException
FailedToAcquireRegisterLeaseException
protected void beforeHeartbeat()
beforeHeartbeat
in class SpecificMasterBlockSync
Copyright © 2023. All Rights Reserved.