@Override public boolean terminateNow() { shutdown(); return true; }
private int triggerShutdown() { if (!shutdownRequested.get()) { shutdown(); } return Integer.MAX_VALUE; }
@Override public void shutdown() { int i = ntsArray.length; while (--i>=0) { if (null != ntsArray[i]) { if (!ScriptedNonThreadScheduler.isShutdownRequested(ntsArray[i])) { ntsArray[i].shutdown(); } } } }
@Override public void run() { try { playScript(this); } catch (InterruptedException e) { Thread.currentThread().interrupt(); shutdown(); } }
@Override public void startup() { if (null==stages) { return; } modificationLock.lock(); //hold the lock try { startupAllStages(stages.length, globalStartupLockCheck); setupHousekeeping(); } catch (RuntimeException re) { shutdown(); } }
@Override public void run() { Thread.currentThread().setName(name()); nts.startup(); try { allStagesLatch.await(); } catch (InterruptedException e) { } catch (BrokenBarrierException e) { } try { long c = 0; while (!ScriptedNonThreadScheduler.isShutdownRequested(nts)) { ScriptedNonThreadScheduler.playScript(nts); if ((++c&0xFFFF)==0) { hangDetection(System.nanoTime()); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); nts.shutdown(); return; } }
private void processException(PronghornStage stage, Exception e) { recordTheException(stage, e, this); ////////////////////// //check the output pipes to ensure no writes are in progress ///////////////////// int c = GraphManager.getOutputPipeCount(graphManager, stage.stageId); for(int i=1; i<=c; i++) { if (Pipe.isInBlobFieldWrite((Pipe<?>) GraphManager.getOutputPipe(graphManager, stage.stageId, i))) { //we can't recover from this exception because write was left open.... shutdown(); break; } } }
this.shutdown(); return;