Search in sources :

Example 1 with Type

use of org.voltdb.messaging.RejoinMessage.Type in project voltdb by VoltDB.

the class Iv2RejoinCoordinator method deliver.

@Override
public void deliver(VoltMessage message) {
    if (!(message instanceof RejoinMessage)) {
        VoltDB.crashLocalVoltDB("Unknown message type " + message.getClass().toString() + " sent to the rejoin coordinator", false, null);
    }
    RejoinMessage rm = (RejoinMessage) message;
    Type type = rm.getType();
    if (type == RejoinMessage.Type.SNAPSHOT_FINISHED) {
        REJOINLOG.info("Finished streaming snapshot to site: " + CoreUtils.hsIdToString(rm.m_sourceHSId));
    } else if (type == RejoinMessage.Type.REPLAY_FINISHED) {
        assert (m_catalog != null);
        boolean schemaHasNoTables = m_catalog.getTables().isEmpty();
        initiateNextSite(schemaHasNoTables);
        onReplayFinished(rm.m_sourceHSId);
    } else if (type == RejoinMessage.Type.INITIATION_RESPONSE) {
        onSiteInitialized(rm.m_sourceHSId, rm.getMasterHSId(), rm.getSnapshotSinkHSId(), rm.schemaHasNoTables());
    } else {
        VoltDB.crashLocalVoltDB("Wrong rejoin message of type " + type + " sent to the rejoin coordinator", false, null);
    }
}
Also used : Type(org.voltdb.messaging.RejoinMessage.Type) SnapshotPathType(org.voltdb.sysprocs.saverestore.SnapshotPathType) RejoinMessage(org.voltdb.messaging.RejoinMessage)

Aggregations

RejoinMessage (org.voltdb.messaging.RejoinMessage)1 Type (org.voltdb.messaging.RejoinMessage.Type)1 SnapshotPathType (org.voltdb.sysprocs.saverestore.SnapshotPathType)1