public static void shutdownStage(GraphManager gm, PronghornStage stage) { stage.shutdown(); }
@Override public void run() { stage.startup(); } };
@Override public String toString() { //must pass stage name so thread knows name return stage.toString(); }
PronghornStage generator2 = new TestGenerator(gm, seed, iterations, inputRing2); generator1.startup(); generator2.startup(); generator1.run(); generator2.run(); generator1.run(); generator2.run(); generator1.shutdown(); generator2.shutdown(); validateResults.startup(); validateResults.run(); validateResults.shutdown();
private static boolean runStageImpl(final ScriptedNonThreadScheduler that, final PronghornStage stage) { try { //NOTE: if no stages have shutdown we could elminate this check with a single boolean. TODO: if this shows up in profiler again. if (!(that.stateArray[stage.stageId] >= GraphManagerStageStateData.STAGE_STOPPING)) { that.setCallerId(stage); assert(that.hangDetectBegin(stage, Thread.currentThread())); stage.run(); assert(that.hangDetectFinish()); that.clearCallerId(); that.timeStartedRunningStage = 0; return false; } else { processShutdown(that.graphManager, stage); return true; } } catch (Exception e) { return processExceptionAndCleanup(that, stage, e); } }
/** * * @param gm * @param parallelId * @param input _in_ The payload that will be routed. * @param outputs _out_ The HTTP request parsed from the NetPayloadSchema. * @param errorResponsePipe _out If error occurs, it will be written to this pipe. * @param log _out_ Logging output. * @param ackStop _out_ Acknowledgment for ReleaseSchema. * @param config * @param coordinator * @param catchAll */ public HTTP1xRouterStage(GraphManager gm, int parallelId, Pipe<NetPayloadSchema>[] input, Pipe<HTTPRequestSchema>[][] outputs, Pipe<ServerResponseSchema> errorResponsePipe, Pipe<HTTPLogRequestSchema> log, Pipe<ReleaseSchema> ackStop, HTTPRouterStageConfig<T,R,V,H> config, ServerCoordinator coordinator, boolean catchAll) { this(gm, parallelId, input, join(outputs), errorResponsePipe, log, ackStop, config, coordinator, catchAll); int inMaxVar = PronghornStage.maxVarLength(input); int outMaxVar = PronghornStage.minVarLength(outputs); if (outMaxVar <= inMaxVar) { throw new UnsupportedOperationException("Input has field lenght of "+inMaxVar+" while output pipe is "+outMaxVar+", output must be larger"); } }
stage.startup(); clearCallerId(); final PronghornStage stage2 = stages[k]; if (null != stage2 && GraphManager.isStageStarted(graphManager, stage2.stageId)) { stage2.requestShutdown();
this.rollingSize = PronghornStage.maxVarLength(encryptedContent)*2;
public void shutdown() { if (null!=firstStage) { firstStage.requestShutdown(); firstStage=null; } connections = null; optionalStageProcessor = null; }
public ReactiveManagerPipeConsumer(Object behavior, ReactiveOperators operators, Pipe[] inputs) { this.behavior = behavior; this.inputs = inputs; assert(PronghornStage.noNulls(inputs)); this.operators = new ReactiveOperator[inputs.length]; boolean doNotThrow = (behavior instanceof TickListenerBase); int i = inputs.length; while (--i>=0) { this.operators[i] = operators.getOperator(inputs[i], doNotThrow); } }
protected PronghornStage(GraphManager graphManager, Pipe[] inputs, Pipe output) { assert(null!=inputs) : "Use NONE"; assert(null!=output) : "Use NONE"; assert(noContainedNull(inputs)) : "Null disovered in inputs array"; assert(output!=null); this.stageId = GraphManager.newStageId(graphManager); this.boxedStageId = this.stageId; this.hash = PronghornStage.class.hashCode() ^ stageId; this.graphManager = graphManager; GraphManager.register(graphManager, this, inputs, output); GraphManager.addNota(graphManager, GraphManager.THREAD_GROUP, null, this);//This provides room for assignment later }
protected static int minVarLength(Pipe<?>[][] pipes) { int result = Integer.MAX_VALUE; int i = pipes.length; while (--i>=0) { result = Math.max(result, minVarLength(pipes[i])); } return result; }
@Override public String toString() { //must pass stage name so thread knows name return stage.toString(); }
stage.run(); clearCallerId(); stage = nextStage(id);
public JoinBlockingBehavior(MsgRuntime<?,?,?> msgRuntime, Pipe<RawDataSchema>[] inputPipes, String[] targetTopics, TargetSelector selector) { this.inputPipes = inputPipes; this.selector = selector; PipeConfigManager pcm = new PipeConfigManager(4, MsgRuntime.defaultCommandChannelLength, MsgRuntime.defaultCommandChannelMaxPayload); BuilderImpl builder = MsgRuntime.builder(msgRuntime); int dataLen = PronghornStage.maxVarLength(inputPipes); int count = inputPipes[0].config().minimumFragmentsOnPipe(); //build each of the target publish services so they can be indexed by targetTopics position targetService = new PubSubFixedTopicService[targetTopics.length]; int i = targetTopics.length; while (--i>=0) { targetService[i] = builder.newCommandChannel(msgRuntime.constructingParallelInstance(), pcm) .newPubSubService(targetTopics[i], count, dataLen); } }
public void shutdown() { if (null!=firstStage) { firstStage.requestShutdown(); firstStage = null; } socketHolder = null; optionalStageProcessor = null; selectors = null; }
this.incomingSubsAndPubsPipe = incomingSubsAndPubsPipe; this.outgoingMessagePipes = outgoingMessagePipes; assert(PronghornStage.noNulls(incomingSubsAndPubsPipe)); assert(goPipe.length == ackPipe.length) : "should be one ack pipe for every go pipe"; assert(goPipe.length == incomingSubsAndPubsPipe.length) : "Publish/Subscribe should be one pub sub pipe for every go "+goPipe.length+" vs "+incomingSubsAndPubsPipe.length;
protected PronghornStage(GraphManager graphManager, Pipe input, Pipe[] outputs) { assert(null!=input) : "Use NONE"; assert(null!=outputs) : "Use NONE"; assert(noContainedNull(outputs)) : "Null disovered in outputs array"; assert(input!=null); this.stageId = GraphManager.newStageId(graphManager); this.boxedStageId = this.stageId; this.hash = PronghornStage.class.hashCode() ^ stageId; this.graphManager = graphManager; GraphManager.register(graphManager, this, input, outputs); GraphManager.addNota(graphManager, GraphManager.THREAD_GROUP, null, this);//This provides room for assignment later }
public void addOutputPronghornPipes(Pipe ... pipes) { outputPipes = PronghornStage.join(outputPipes, pipes); }