Search in sources :

Example 1 with IControllerService

use of org.apache.hyracks.api.service.IControllerService in project asterixdb by apache.

the class StartupTaskResponseMessage method handle.

@Override
public void handle(INcApplicationContext appCtx) throws HyracksDataException, InterruptedException {
    INCMessageBroker broker = (INCMessageBroker) appCtx.getServiceContext().getMessageBroker();
    IControllerService cs = appCtx.getServiceContext().getControllerService();
    boolean success = true;
    HyracksDataException exception = null;
    try {
        for (INCLifecycleTask task : tasks) {
            task.perform(cs);
        }
    } catch (HyracksDataException e) {
        success = false;
        exception = e;
    }
    NCLifecycleTaskReportMessage result = new NCLifecycleTaskReportMessage(nodeId, success);
    result.setException(exception);
    try {
        broker.sendMessageToCC(result);
    } catch (Exception e) {
        LOGGER.log(Level.SEVERE, "Failed sending message to cc", e);
        throw HyracksDataException.create(e);
    }
}
Also used : INCLifecycleTask(org.apache.asterix.common.api.INCLifecycleTask) INCMessageBroker(org.apache.asterix.common.messaging.api.INCMessageBroker) IControllerService(org.apache.hyracks.api.service.IControllerService) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException)

Aggregations

INCLifecycleTask (org.apache.asterix.common.api.INCLifecycleTask)1 INCMessageBroker (org.apache.asterix.common.messaging.api.INCMessageBroker)1 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)1 IControllerService (org.apache.hyracks.api.service.IControllerService)1