Class SearchChunkResponseParser
- java.lang.Object
-
- com.couchbase.client.core.io.netty.chunk.BaseChunkResponseParser<SearchChunkHeader,SearchChunkRow,SearchChunkTrailer>
-
- com.couchbase.client.core.io.netty.search.SearchChunkResponseParser
-
- All Implemented Interfaces:
ChunkResponseParser<SearchChunkHeader,SearchChunkRow,SearchChunkTrailer>
public class SearchChunkResponseParser extends BaseChunkResponseParser<SearchChunkHeader,SearchChunkRow,SearchChunkTrailer>
-
-
Constructor Summary
Constructors Constructor Description SearchChunkResponseParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoCleanup()Give subclasses a chance to reset their state.Optional<CouchbaseException>error()If the parser sees an error, it should fill this optional so that if the IO layer needs to fail the topmost future it will be passed in.Optional<SearchChunkHeader>header(boolean lastChunk)Once the header is completely available, returns a non-absent value of it.protected JsonStreamParser.BuilderparserBuilder()Subclass implements this to return the "meat" of the decoding, the chunk parser.voidsignalComplete()Called when the JSON stream has been parsed completely and successfully.-
Methods inherited from class com.couchbase.client.core.io.netty.chunk.BaseChunkResponseParser
cleanup, completeRows, completeTrailer, decodingFailure, emitRow, endOfInput, failRows, feed, initialize, isHeaderComplete, markHeaderComplete, requestContext, responseHeader, rows, trailer, updateRequestContext, updateResponseHeader
-
-
-
-
Method Detail
-
doCleanup
protected void doCleanup()
Description copied from class:BaseChunkResponseParserGive subclasses a chance to reset their state.- Specified by:
doCleanupin classBaseChunkResponseParser<SearchChunkHeader,SearchChunkRow,SearchChunkTrailer>
-
parserBuilder
protected JsonStreamParser.Builder parserBuilder()
Description copied from class:BaseChunkResponseParserSubclass implements this to return the "meat" of the decoding, the chunk parser.- Specified by:
parserBuilderin classBaseChunkResponseParser<SearchChunkHeader,SearchChunkRow,SearchChunkTrailer>
-
header
public Optional<SearchChunkHeader> header(boolean lastChunk)
Description copied from interface:ChunkResponseParserOnce the header is completely available, returns a non-absent value of it.It is important to provide a non-absent value even if some parts are optional because the related IO components will only proceed if a header is available eventually.
- Parameters:
lastChunk- if we are currently parsing the last chunk.
-
error
public Optional<CouchbaseException> error()
Description copied from interface:ChunkResponseParserIf the parser sees an error, it should fill this optional so that if the IO layer needs to fail the topmost future it will be passed in.
-
signalComplete
public void signalComplete()
Description copied from class:BaseChunkResponseParserCalled when the JSON stream has been parsed completely and successfully.- Specified by:
signalCompletein classBaseChunkResponseParser<SearchChunkHeader,SearchChunkRow,SearchChunkTrailer>
-
-