@Override protected void doRun() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ncs.getContext().getStateDumpHandler().dumpState(baos); ncs.getClusterController(ccId).notifyStateDump(ncs.getContext().getNodeId(), stateDumpId, baos.toString("UTF-8")); } }
@Override public void run() { NCServiceContext ctx = ncs.getContext(); try { IMessage data = (IMessage) DeploymentUtils.deserialize(message, deploymentId, ctx); if (ctx.getMessageBroker() != null) { ctx.getMessageBroker().receivedMessage(data, nodeId); } else { LOGGER.log(Level.WARN, "Message was sent, but no Message Broker set!"); } } catch (Exception e) { LOGGER.warn("Error in application message delivery!", e); throw new RuntimeException(e); } }
@Override public void run() { DeploymentStatus status; try { DeploymentUtils.deploy(deploymentId, binaryURLs, ncs.getContext().getJobSerializerDeserializerContainer(), ncs.getServerContext(), true); status = DeploymentStatus.SUCCEED; } catch (Exception e) { status = DeploymentStatus.FAIL; e.printStackTrace(); } try { IClusterController ccs = ncs.getClusterController(ccId); ccs.notifyDeployBinary(deploymentId, ncs.getId(), status); } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void run() { DeploymentStatus status; try { DeploymentUtils.undeploy(deploymentId, ncs.getContext().getJobSerializerDeserializerContainer(), ncs.getServerContext()); status = DeploymentStatus.SUCCEED; } catch (Exception e) { status = DeploymentStatus.FAIL; } try { IClusterController ccs = ncs.getClusterController(ccId); ccs.notifyDeployBinary(deploymentId, ncs.getId(), status); } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void run() { try { if (!upsert) { ncs.checkForDuplicateDeployedJobSpec(deployedJobSpecId); } ActivityClusterGraph acg = (ActivityClusterGraph) DeploymentUtils.deserialize(acgBytes, null, ncs.getContext()); ncs.storeActivityClusterGraph(deployedJobSpecId, acg); } catch (HyracksException e) { try { ncs.getClusterController(ccId).notifyDeployedJobSpecFailure(deployedJobSpecId, ncs.getId()); } catch (Exception e1) { e1.printStackTrace(); } } }
public static void send(CcId ccId, NodeControllerService cs, NodeStatus nodeStatus, SystemState systemState) throws HyracksDataException { try { RegistrationTasksRequestMessage msg = new RegistrationTasksRequestMessage(cs.getId(), nodeStatus, systemState); ((INCMessageBroker) cs.getContext().getMessageBroker()).sendMessageToCC(ccId, msg); } catch (Exception e) { LOGGER.log(Level.ERROR, "Unable to send RegistrationTasksRequestMessage to CC", e); throw HyracksDataException.create(e); } }
@Override public void run() { String result; try { result = ThreadDumpUtil.takeDumpJSONString(); } catch (Exception e) { LOGGER.log(Level.WARN, "Exception taking thread dump", e); result = null; } try { ncs.getClusterController(ccId).notifyThreadDump(ncs.getContext().getNodeId(), requestId, result); } catch (Exception e) { LOGGER.log(Level.WARN, "Exception sending thread dump to CC", e); } } }
try { ncs.updateMaxJobId(jobId); NCServiceContext serviceCtx = ncs.getContext(); Joblet joblet = getOrCreateLocalJoblet(deploymentId, serviceCtx, acgBytes); if (ncs.getNodeStatus() != NodeStatus.ACTIVE) {
public IHyracksTaskContext createTestContext(JobId jobId, int partition, boolean withMessaging) throws HyracksDataException { IHyracksTaskContext ctx = TestUtils.create(KB32, ExecutionTestUtil.integrationUtil.ncs[0].getIoManager()); if (withMessaging) { TaskUtil.put(HyracksConstants.KEY_MESSAGE, new VSizeFrame(ctx), ctx); } IHyracksJobletContext jobletCtx = Mockito.mock(IHyracksJobletContext.class); JobEventListenerFactory factory = new JobEventListenerFactory(new TxnId(jobId.getId()), true); Mockito.when(jobletCtx.getJobletEventListenerFactory()).thenReturn(factory); Mockito.when(jobletCtx.getServiceContext()).thenReturn(ExecutionTestUtil.integrationUtil.ncs[0].getContext()); Mockito.when(jobletCtx.getJobId()).thenReturn(jobId); ctx = Mockito.spy(ctx); Mockito.when(ctx.getJobletContext()).thenReturn(jobletCtx); Mockito.when(ctx.getIoManager()).thenReturn(ExecutionTestUtil.integrationUtil.ncs[0].getIoManager()); TaskAttemptId taskId = new TaskAttemptId(new TaskId(new ActivityId(new OperatorDescriptorId(0), 0), partition), 0); Mockito.when(ctx.getTaskAttemptId()).thenReturn(taskId); return ctx; }