Search in sources :

Example 1 with MetaCommand

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();
    }
}
Also used : MetaCommand(alluxio.grpc.MetaCommand) IOException(java.io.IOException)

Aggregations

MetaCommand (alluxio.grpc.MetaCommand)1 IOException (java.io.IOException)1