use of org.apache.asterix.app.replication.message.StartupTaskResponseMessage in project asterixdb by apache.
the class MetadataNodeFaultToleranceStrategy method process.
private synchronized void process(StartupTaskRequestMessage msg) throws HyracksDataException {
final String nodeId = msg.getNodeId();
final SystemState state = msg.getState();
final boolean isParticipant = replicationStrategy.isParticipant(nodeId);
List<INCLifecycleTask> tasks;
if (!isParticipant) {
tasks = buildNonParticipantStartupSequence(nodeId, state);
} else {
tasks = buildParticipantStartupSequence(nodeId, state);
}
StartupTaskResponseMessage response = new StartupTaskResponseMessage(nodeId, tasks);
try {
messageBroker.sendApplicationMessageToNC(response, msg.getNodeId());
} catch (Exception e) {
throw HyracksDataException.create(e);
}
}
use of org.apache.asterix.app.replication.message.StartupTaskResponseMessage in project asterixdb by apache.
the class NoFaultToleranceStrategy method process.
private void process(StartupTaskRequestMessage msg) throws HyracksDataException {
final String nodeId = msg.getNodeId();
List<INCLifecycleTask> tasks = buildNCStartupSequence(msg.getNodeId(), msg.getState());
StartupTaskResponseMessage response = new StartupTaskResponseMessage(nodeId, tasks);
try {
messageBroker.sendApplicationMessageToNC(response, msg.getNodeId());
} catch (Exception e) {
throw HyracksDataException.create(e);
}
}
use of org.apache.asterix.app.replication.message.StartupTaskResponseMessage in project asterixdb by apache.
the class AutoFaultToleranceStrategy method process.
private synchronized void process(StartupTaskRequestMessage msg) throws HyracksDataException {
final String nodeId = msg.getNodeId();
final SystemState state = msg.getState();
List<INCLifecycleTask> tasks;
if (state == SystemState.BOOTSTRAPPING || state == SystemState.HEALTHY) {
tasks = buildStartupSequence(nodeId);
} else {
// failed node returned. Need to start failback process
tasks = buildFailbackStartupSequence();
}
StartupTaskResponseMessage response = new StartupTaskResponseMessage(nodeId, tasks);
try {
messageBroker.sendApplicationMessageToNC(response, msg.getNodeId());
} catch (Exception e) {
throw HyracksDataException.create(e);
}
}
Aggregations