Module org.elasticsearch.server
Package org.elasticsearch.rest
Interface BaseRestHandler.RequestBodyChunkConsumer
- All Superinterfaces:
AutoCloseable,BaseRestHandler.RestChannelConsumer,CheckedConsumer<RestChannel,,Exception> Closeable,Releasable
- Enclosing class:
BaseRestHandler
public static interface BaseRestHandler.RequestBodyChunkConsumer
extends BaseRestHandler.RestChannelConsumer
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleChunk(RestChannel channel, ReleasableBytesReference chunk, boolean isLast) Handle one chunk of the request body.default voidCalled when the stream closes.Methods inherited from interface org.elasticsearch.rest.BaseRestHandler.RestChannelConsumer
closeMethods inherited from interface org.elasticsearch.core.CheckedConsumer
accept, andThen
-
Method Details
-
handleChunk
Handle one chunk of the request body. The handler must close the chunk once it is no longer needed to avoid leaking.- Parameters:
channel- The rest channel associated to the requestchunk- The chunk of request body that is ready for processingisLast- Whether the chunk is the last one of the request
-
streamClose
default void streamClose()Called when the stream closes. This could happen prior to the completion of the request if the underlying channel was closed. Implementors should do their best to clean up resources and early terminate request processing if it is triggered before a response is generated.
-