Module org.elasticsearch.server
Interface ChunkedToXContent
- All Superinterfaces:
ToXContent
- All Known Implementing Classes:
BaseNodesXContentResponse
,FieldCapabilitiesResponse
,GetMappingsResponse
,GetSnapshotsResponse
,IndicesSegmentResponse
,NodesStatsResponse
,RecoveryResponse
An extension of
ToXContent
that can be serialized in chunks by creating an Iterator<ToXContent>
.
This is used by the REST layer to implement flow control that does not rely on blocking the serializing thread when writing the
serialized bytes to a non-blocking channel.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Method Summary
Modifier and TypeMethodDescriptiondefault XContentBuilder
toXContent
(XContentBuilder builder, ToXContent.Params params) Iterator<? extends ToXContent>
Create an iterator ofToXContent
chunks, that must be serialized individually with the sameXContentBuilder
andToXContent.Params
for each call until it is fully drained.Methods inherited from interface org.elasticsearch.xcontent.ToXContent
isFragment
-
Method Details
-
toXContentChunked
Iterator<? extends ToXContent> toXContentChunked()Create an iterator ofToXContent
chunks, that must be serialized individually with the sameXContentBuilder
andToXContent.Params
for each call until it is fully drained.- Returns:
- iterator over chunks of
ToXContent
-
toXContent
default XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-