Class PlanStreamInput
java.lang.Object
java.io.InputStream
org.elasticsearch.common.io.stream.StreamInput
org.elasticsearch.common.io.stream.FilterStreamInput
org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput
org.elasticsearch.xpack.esql.io.stream.PlanStreamInput
- All Implemented Interfaces:
Closeable,AutoCloseable
A customized stream input used to deserialize ESQL physical plan fragments. Complements stream
input with methods that read plan nodes, Attributes, Expressions, etc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA Mapper of stream named id, represented as a primitive long value, to NameId instance. -
Field Summary
Fields inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
delegate -
Constructor Summary
ConstructorsConstructorDescriptionPlanStreamInput(StreamInput streamInput, NamedWriteableRegistry namedWriteableRegistry, Configuration configuration) PlanStreamInput(StreamInput streamInput, NamedWriteableRegistry namedWriteableRegistry, Configuration configuration, PlanStreamInput.NameIdMapper idMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()mapNameId(long l) <A extends Attribute>
AreadAttributeWithCache(org.elasticsearch.core.CheckedFunction<StreamInput, A, IOException> constructor) Reads an Attribute using the attribute cache.Read aBlockas part of the plan.Block[]Read an array ofBlocks as part of the plan.Reads a cached string, serialized withPlanStreamOutput.writeCachedString(String).<A extends EsField>
AThe query sent by the user to build this plan.sourceText(String viewName) Returns the query text for the given view name, or the main query if viewName is null.Methods inherited from class org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput
namedWriteableRegistry, readNamedWriteable, readNamedWriteable, readNamedWriteableCollectionAsListMethods inherited from class org.elasticsearch.common.io.stream.FilterStreamInput
available, ensureCanReadBytes, getTransportVersion, read, read, readAllToReleasableBytesReference, readByte, readBytes, readInt, readLong, readReleasableBytesReference, readReleasableBytesReference, readShort, readSlicedBytesReference, readString, readVInt, readVLong, reset, setTransportVersion, supportReadAllToReleasableBytesReferenceMethods inherited from class org.elasticsearch.common.io.stream.StreamInput
doReadString, readArray, readArraySize, readBigInteger, readBoolean, readByteArray, readBytesRef, readBytesRef, readBytesReference, readBytesReference, readBytesRefOrNullIfEmpty, readCollection, readCollectionAsImmutableList, readCollectionAsImmutableSet, readCollectionAsList, readCollectionAsSet, readDouble, readDoubleArray, readEnum, readEnumSet, readException, readFloat, readFloatArray, readFully, readGenericMap, readGenericValue, readGeoPoint, readImmutableMap, readImmutableMap, readImmutableOpenMap, readInstant, readIntArray, readLongArray, readMap, readMap, readMapOfLists, readMapValues, readMapValues, readOptional, readOptionalArray, readOptionalBoolean, readOptionalByteArray, readOptionalBytesReference, readOptionalCollectionAsList, readOptionalDouble, readOptionalEnum, readOptionalException, readOptionalFloat, readOptionalFloatArray, readOptionalImmutableMap, readOptionalInstant, readOptionalInt, readOptionalLong, readOptionalNamedWriteable, readOptionalNamedWriteableCollectionAsList, readOptionalSecureString, readOptionalString, readOptionalStringArray, readOptionalStringCollectionAsList, readOptionalText, readOptionalTimeValue, readOptionalVInt, readOptionalVLong, readOptionalWriteable, readOptionalZoneId, readOrderedMap, readSecureString, readSlicedBytesReference, readStringArray, readStringCollectionAsImmutableList, readStringCollectionAsList, readText, readTimeValue, readVIntArray, readVIntSlow, readVLongArray, readVLongSlow, readZLong, readZoneId, throwEOF, throwOnBrokenVInt, throwOnBrokenVLong, throwOnNullRead, tryReadStringFromBytes, wrap, wrapMethods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
PlanStreamInput
public PlanStreamInput(StreamInput streamInput, NamedWriteableRegistry namedWriteableRegistry, Configuration configuration) -
PlanStreamInput
public PlanStreamInput(StreamInput streamInput, NamedWriteableRegistry namedWriteableRegistry, Configuration configuration, PlanStreamInput.NameIdMapper idMapper) - Parameters:
idMapper- should always be null in production! Custom mappers are only used in tests to force ID values to be the same after serialization and deserialization, which is not the case when they are generated as usual.
-
-
Method Details
-
configuration
- Throws:
IOException
-
readCachedBlock
Read aBlockas part of the plan.These
Blocks are not tracked byBlockFactoryand closing them does nothing so they should be small. We do make sure not to send duplicates, reusing blocks sent as part of theConfiguration.tables()if possible, otherwise sending a Block inline.- Throws:
IOException
-
readCachedBlockArray
Read an array ofBlocks as part of the plan.These
Blocks are not tracked byBlockFactoryand closing them does nothing so they should be small. We do make sure not to send duplicates, reusing blocks sent as part of theConfiguration.tables()if possible, otherwise sending a Block inline.- Throws:
IOException
-
sourceText
The query sent by the user to build this plan. This is used to rebuildSourcewithout sending the query over the wire over and over and over again. -
sourceText
Returns the query text for the given view name, or the main query if viewName is null. This is used during Source deserialization to look up the correct query string based on where the Source originated from. -
mapNameId
-
readAttributeWithCache
public <A extends Attribute> A readAttributeWithCache(org.elasticsearch.core.CheckedFunction<StreamInput, A, throws IOExceptionIOException> constructor) Reads an Attribute using the attribute cache.- Parameters:
constructor- the constructor needed to build the actual attribute when read from the wire- Returns:
- An attribute; this will generally be the same type as the provided constructor
- Throws:
IOException
-
readEsFieldWithCache
- Throws:
IOException
-
readCachedString
Reads a cached string, serialized withPlanStreamOutput.writeCachedString(String).- Throws:
IOException
-
readOptionalCachedString
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterStreamInput- Throws:
IOException
-