@Override public void run() { shutdownPosition = parseSingleByteBuffer(this, activeByteBuffer); if (shutdownPosition>=activeByteBuffer.limit()) { resetForNextByteBuffer(this); Pipe.publishAllBatchedWrites(outputRing); requestShutdown(); } }
LineSplitterByteBufferStage lineSplitter = new LineSplitterByteBufferStage(gm, data, linesRing); lineSplitter.startup(); lineSplitter.run(); lineSplitter.shutdown();
LineSplitterByteBufferStage lineSplitter = new LineSplitterByteBufferStage(gm, data, linesRing); lineSplitter.startup(); lineSplitter.blockingRun(); lineSplitter.shutdown();
LineSplitterByteBufferStage lineSplitter = new LineSplitterByteBufferStage(gm, data, linesRing); FieldSplitterStage fieldSplitter = new FieldSplitterStage(gm, linesRing, fieldsRing);
/** * * @param graphManager * @param sourceByteBuffer * @param outputRing _out_ Resulting byte buffer ring. */ public LineSplitterByteBufferStage(GraphManager graphManager, ByteBuffer sourceByteBuffer, Pipe outputRing) { super(graphManager, NONE, outputRing); this.activeByteBuffer=sourceByteBuffer; this.outputRing=outputRing; if (Pipe.from(outputRing) != RawDataSchema.FROM) { throw new UnsupportedOperationException("This class can only be used with the very simple RAW_BYTES catalog of messages."); } stepSize = RawDataSchema.FROM.fragDataSize[0]; //NOTE: this block has constants that could be moved up and out quoter = new byte[256]; //these are all zeros quoter['"'] = 1; //except for the value of quote. if (outputRing.maxVarLen<1) { throw new UnsupportedOperationException(); } resetForNextByteBuffer(this); }
if (isEOL(b) ) {
LineSplitterByteBufferStage lineSplitter = new LineSplitterByteBufferStage(gm, data, linesRing);
public void blockingRun() { do { shutdownPosition = parseSingleByteBuffer(this, activeByteBuffer); } while (shutdownPosition<activeByteBuffer.limit()); resetForNextByteBuffer(this); Pipe.publishAllBatchedWrites(outputRing); requestShutdown(); }