Class DelayableWriteable<T extends Writeable>

java.lang.Object
org.elasticsearch.common.io.stream.DelayableWriteable<T>
All Implemented Interfaces:
Closeable, AutoCloseable, Writeable, org.elasticsearch.core.Releasable
Direct Known Subclasses:
DelayableWriteable.Serialized

public abstract class DelayableWriteable<T extends Writeable> extends Object implements Writeable, org.elasticsearch.core.Releasable
A holder for Writeables that delays reading the underlying object on the receiving end. To be used for objects whose deserialized representation is inefficient to keep in memory compared to their corresponding serialized representation. The node that produces the Writeable calls referencing(Writeable) to create a DelayableWriteable that serializes the inner object first to a buffer and writes the content of the buffer to the StreamOutput. The receiver node calls delayed(Reader, StreamInput) to create a DelayableWriteable that reads the buffer from the @link StreamInput but delays creating the actual object by calling expand() when needed. Multiple DelayableWriteables coming from different nodes may be buffered on the receiver end, which may hold a mix of DelayableWriteables that were produced locally (hence expanded) as well as received form another node (hence subject to delayed expansion). When such objects are buffered for some time it may be desirable to force their buffering in serialized format by calling asSerialized(Reader, NamedWriteableRegistry).