@Override public void run() { int i = this.inputs.length; while (--i >= 0) { process(inputs[i], outputs[i]); } }
private static void publishBodiesMessage(FileReadModuleStage that, int verb, int sequence, int pathId, Pipe<HTTPRequestSchema> input, Pipe<ServerResponseSchema> output) throws IOException { if (VERB_GET == verb) { //head does not get body that.activePosition = 0; that.activeNeedsStartReposition = true; that.writeBodiesWhileRoom(that.activeChannelHigh, that.activeChannelLow, sequence, that.activeFileChannel, pathId, input, output); } else { publishNoBodyMessage(that, verb, input); } }
public static ResourceModuleStage<?, ?, ?, ?> newInstance(GraphManager graphManager, Pipe<HTTPRequestSchema>[] inputs, Pipe<ServerResponseSchema>[] outputs, HTTPSpecification<?, ?, ?, ?> httpSpec, String prefix, String resourceName) { return new ResourceModuleStage(graphManager, inputs, outputs, httpSpec, prefix, resourceName); }
public RouteFilter addFileServer(String path) { //adds server to all routes final int parallelIndex = (-1 == parallelInstanceUnderActiveConstruction) ? 0 : parallelInstanceUnderActiveConstruction; //due to internal implementation we must keep the same number of outputs as inputs. Pipe<HTTPRequestSchema>[] inputs = new Pipe[1]; Pipe<ServerResponseSchema>[] outputs = new Pipe[1]; populateHTTPInOut(inputs, outputs, 0, parallelIndex); FileReadModuleStage.newInstance(gm, inputs, outputs, builder.httpSpec, buildFilePath(path)); return new StageRouteFilter(inputs[0], builder, parallelIndex); }
public static FileReadModuleStage<?, ?, ?, ?> newInstance(GraphManager graphManager, Pipe<HTTPRequestSchema> input, Pipe<ServerResponseSchema> output, HTTPSpecification<?, ?, ?, ?> httpSpec, String resourceRootFolder, String resourceDefaultPath) { return new FileReadModuleStage(graphManager, new Pipe[]{input}, new Pipe[]{output}, httpSpec, resourceRootFolder, resourceDefaultPath); }
public static SummaryModuleStage<?, ?, ?, ?> newInstance(GraphManager graphManager, PipeMonitorCollectorStage monitor, Pipe<HTTPRequestSchema>[] inputs, Pipe<ServerResponseSchema>[] outputs, HTTPSpecification<?, ?, ?, ?> httpSpec) { return new SummaryModuleStage(graphManager, inputs, outputs, httpSpec, monitor); }
public static DotModuleStage<?, ?, ?, ?> newInstance(GraphManager graphManager, PipeMonitorCollectorStage monitor, Pipe<HTTPRequestSchema>[] inputs, Pipe<ServerResponseSchema>[] outputs, HTTPSpecification<?, ?, ?, ?> httpSpec) { return new DotModuleStage(graphManager, inputs, outputs, httpSpec, monitor); }
protected void definePayload() { definePayload(null,0,0,0); }
/** * * @param graphManager * @param inputs _in_ Input pipes with HTTPRequestSchema * @param outputs _out_ Output pipes as several ServerResponseSchema * @param httpSpec * @param otherInputs _in_ Multiple other input pipes to respond to */ public ByteArrayPayloadResponseStage(GraphManager graphManager, Pipe<HTTPRequestSchema>[] inputs, Pipe<ServerResponseSchema>[] outputs, HTTPSpecification<T, R, V, H> httpSpec, Pipe[] otherInputs) { super(graphManager, join(inputs,otherInputs), outputs); this.httpSpec = httpSpec; this.inputs = inputs; this.outputs = outputs; this.graphManager = graphManager; assert(inputs.length == inputs.length); }
private int countAllKnownFiles(File[] children) { int total = 0; int i = children.length; while (--i>=0) { File child = children[i]; if ((!child.isHidden()) && child.canRead()) { if (child.isDirectory()) { total += (countAllKnownFiles(child.listFiles())+1); } else { total++; } } } return total; }
private SummaryModuleStage(GraphManager graphManager, Pipe<HTTPRequestSchema>[] inputs, Pipe<ServerResponseSchema>[] outputs, HTTPSpecification httpSpec, PipeMonitorCollectorStage monitor) { super(graphManager, inputs, outputs, httpSpec, estimate(graphManager)); this.monitor = monitor; if (inputs.length>1) { GraphManager.addNota(graphManager, GraphManager.LOAD_MERGE, GraphManager.LOAD_MERGE, this); } }
@Override public void startup() { //how to write out to multiples??? //create single output upon request.. //what about multiple users asking for the same data?? DataOutputBlobWriter out = null; //Data output, HTTP response... StreamingVisitorReader readerLocal = buildJSONVisitor(out, monitorInput); reader = readerLocal; reader.startup(); }
@Override public void shutdown() { super.shutdown(); PipeMonitorModuleStage.this.requestShutdown(); } };
private static void publishNoBodyMessage(FileReadModuleStage that, int verb, Pipe<HTTPRequestSchema> input) { if (VERB_HEAD == verb){ that.activeFileChannel = null; Pipe.confirmLowLevelRead(input, that.activeReadMessageSize); Pipe.releaseReadLock(input); } else { otherVerbs(); } }
public static FileReadModuleStage<?, ?, ?, ?> newInstance(GraphManager graphManager, Pipe<HTTPRequestSchema>[] inputs, Pipe<ServerResponseSchema>[] output, HTTPSpecification<?, ?, ?, ?> httpSpec, String resourceRootFolder, String resourceDefaultPath) { return new FileReadModuleStage(graphManager, inputs, output, httpSpec, resourceRootFolder, resourceDefaultPath); }
public static ResourceModuleStage<?, ?, ?, ?> newInstance(GraphManager graphManager, Pipe<HTTPRequestSchema> input, Pipe<ServerResponseSchema> output, HTTPSpecification<?, ?, ?, ?> httpSpec, String prefix, String resourceName) { return new ResourceModuleStage(graphManager, new Pipe[]{input}, new Pipe[]{output}, httpSpec, prefix, resourceName); }
public static SummaryModuleStage<?, ?, ?, ?> newInstance(GraphManager graphManager, Pipe<HTTPRequestSchema> input, Pipe<ServerResponseSchema> output, HTTPSpecification<?, ?, ?, ?> httpSpec) { PipeMonitorCollectorStage monitor = PipeMonitorCollectorStage.attach(graphManager); return new SummaryModuleStage(graphManager, new Pipe[]{input}, new Pipe[]{output}, httpSpec, monitor); }
public static DotModuleStage<?, ?, ?, ?> newInstance(GraphManager graphManager, Pipe<HTTPRequestSchema> input, Pipe<ServerResponseSchema> output, HTTPSpecification<?, ?, ?, ?> httpSpec) { PipeMonitorCollectorStage monitor = PipeMonitorCollectorStage.attach(graphManager); return new DotModuleStage(graphManager, new Pipe[]{input}, new Pipe[]{output}, httpSpec, monitor); }
public static FileReadModuleStage<?, ?, ?, ?> newInstance(GraphManager graphManager, Pipe<HTTPRequestSchema>[] inputs, Pipe<ServerResponseSchema>[] output, HTTPSpecification<?, ?, ?, ?> httpSpec, File rootPath) { return new FileReadModuleStage(graphManager, inputs, output, httpSpec, rootPath); }
public static FileReadModuleStage<?, ?, ?, ?> newInstance(GraphManager graphManager, Pipe<HTTPRequestSchema> input, Pipe<ServerResponseSchema> output, HTTPSpecification<?, ?, ?, ?> httpSpec, File rootPath) { return new FileReadModuleStage(graphManager, new Pipe[]{input}, new Pipe[]{output}, httpSpec, rootPath); }