java.lang.Object
org.elasticsearch.rest.LoggingChunkedRestResponseBody
- All Implemented Interfaces:
Closeable,AutoCloseable,Releasable,ChunkedRestResponseBody
-
Field Summary
Fields inherited from interface org.elasticsearch.rest.ChunkedRestResponseBody
logger -
Constructor Summary
ConstructorsConstructorDescriptionLoggingChunkedRestResponseBody(ChunkedRestResponseBody inner, OutputStream loggerStream) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()encodeChunk(int sizeHint, Recycler<org.apache.lucene.util.BytesRef> recycler) Serializes approximately as many bytes of the response as request bysizeHintto aReleasableBytesReferencethat is created from buffers backed by the givenrecycler.booleanisDone()
-
Constructor Details
-
LoggingChunkedRestResponseBody
-
-
Method Details
-
isDone
public boolean isDone()- Specified by:
isDonein interfaceChunkedRestResponseBody- Returns:
- true once this response has been written fully.
-
encodeChunk
public ReleasableBytesReference encodeChunk(int sizeHint, Recycler<org.apache.lucene.util.BytesRef> recycler) throws IOException Description copied from interface:ChunkedRestResponseBodySerializes approximately as many bytes of the response as request bysizeHintto aReleasableBytesReferencethat is created from buffers backed by the givenrecycler.- Specified by:
encodeChunkin interfaceChunkedRestResponseBody- Parameters:
sizeHint- how many bytes to approximately serialize for the given chunkrecycler- recycler used to acquire buffers- Returns:
- serialized chunk
- Throws:
IOException- on serialization failure
-
getResponseContentTypeString
- Specified by:
getResponseContentTypeStringin interfaceChunkedRestResponseBody- Returns:
- the response Content-Type header value for this response body
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceReleasable
-