Package org.elasticsearch.http.netty4
Class Netty4HttpRequestBodyStream
java.lang.Object
org.elasticsearch.http.netty4.Netty4HttpRequestBodyStream
- All Implemented Interfaces:
Closeable,AutoCloseable,org.elasticsearch.core.Releasable,HttpBody,HttpBody.Stream
Netty based implementation of
HttpBody.Stream.
This implementation utilize ChannelConfig.setAutoRead(boolean)
to prevent entire payload buffering. But sometimes upstream can send few chunks of data despite
autoRead=off. In this case chunks will be buffered until downstream calls HttpBody.Stream.next()-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.http.HttpBody
HttpBody.ByteRefHttpBody, HttpBody.ChunkHandler, HttpBody.Full, HttpBody.Stream -
Constructor Summary
ConstructorsConstructorDescriptionNetty4HttpRequestBodyStream(io.netty.channel.Channel channel, ThreadContext threadContext, ThreadWatchdog.ActivityTracker activityTracker) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTracingHandler(HttpBody.ChunkHandler chunkHandler) voidclose()voidhandleNettyContent(io.netty.handler.codec.http.HttpContent httpContent) handler()voidnext()voidsetHandler(HttpBody.ChunkHandler chunkHandler)
-
Constructor Details
-
Netty4HttpRequestBodyStream
public Netty4HttpRequestBodyStream(io.netty.channel.Channel channel, ThreadContext threadContext, ThreadWatchdog.ActivityTracker activityTracker)
-
-
Method Details
-
handler
- Specified by:
handlerin interfaceHttpBody.Stream
-
setHandler
- Specified by:
setHandlerin interfaceHttpBody.Stream
-
addTracingHandler
- Specified by:
addTracingHandlerin interfaceHttpBody.Stream
-
next
public void next()- Specified by:
nextin interfaceHttpBody.Stream
-
handleNettyContent
public void handleNettyContent(io.netty.handler.codec.http.HttpContent httpContent) -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-