use of alluxio.grpc.MetaCommand in project alluxio by Alluxio.
the class MetaMasterSync method heartbeat.
/**
* Heartbeats to the leader master node.
*/
@Override
public void heartbeat() {
MetaCommand command = null;
try {
if (mMasterId.get() == UNINITIALIZED_MASTER_ID) {
setIdAndRegister();
}
command = mMasterClient.heartbeat(mMasterId.get());
handleCommand(command);
} catch (IOException e) {
// An error occurred, log and ignore it or error if heartbeat timeout is reached
if (command == null) {
LOG.error("Failed to receive leader master heartbeat command.", e);
} else {
LOG.error("Failed to execute leader master heartbeat command: {}", command, e);
}
mMasterClient.disconnect();
}
}
Aggregations