java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportResponse
org.elasticsearch.search.SearchPhaseResult
org.elasticsearch.search.fetch.FetchSearchResult
- All Implemented Interfaces:
Writeable,RefCounted
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from class org.elasticsearch.search.SearchPhaseResult
contextIdFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleandecRef()Note that the lifetime of an outboundTransportMessagelasts at least until it has been fully sent over the network, and it may be closed on a network thread in a context in which there's a risk of stack overflows if on close it calls back into the network layer in a manner that might end up nesting too deeply.Returns the fetch result iff it's included in this response otherwisenullGets the raw bytes of the last chunk.intGets the number of hits in the last chunk bytes.longGets the sequence start for the last chunk embedded in this result.longbooleanhits()voidincRef()voidreleaseCircuitBreakerBytes(CircuitBreaker circuitBreaker) voidsetLastChunkBytes(BytesReference bytes, int hitCount) Sets the raw bytes of the last chunk.voidsetLastChunkSequenceStart(long sequenceStart) Sets the sequence start for the last chunk embedded in this result.voidsetSearchHitsSizeBytes(long bytes) voidshardResult(SearchHits hits, ProfileResult profileResult) booleanvoidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.SearchPhaseResult
clearContextId, getContextId, getRescoreDocIds, getSearchShardTarget, getShardIndex, getShardSearchRequest, hasSearchContext, queryResult, rankFeatureResult, setRescoreDocIds, setSearchShardTarget, setShardIndex, setShardSearchRequestMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRef
-
Constructor Details
-
FetchSearchResult
public FetchSearchResult() -
FetchSearchResult
-
FetchSearchResult
- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classSearchPhaseResult- Throws:
IOException
-
fetchResult
Description copied from class:SearchPhaseResultReturns the fetch result iff it's included in this response otherwisenull- Overrides:
fetchResultin classSearchPhaseResult
-
shardResult
-
hits
-
setSearchHitsSizeBytes
public void setSearchHitsSizeBytes(long bytes) -
getSearchHitsSizeBytes
public long getSearchHitsSizeBytes() -
releaseCircuitBreakerBytes
-
initCounter
-
counterGetAndIncrement
public int counterGetAndIncrement() -
profileResult
-
incRef
public void incRef()- Specified by:
incRefin interfaceRefCounted- Overrides:
incRefin classTransportMessage
-
tryIncRef
public boolean tryIncRef()- Specified by:
tryIncRefin interfaceRefCounted- Overrides:
tryIncRefin classTransportMessage
-
decRef
public boolean decRef()Description copied from class:TransportMessageNote that the lifetime of an outboundTransportMessagelasts at least until it has been fully sent over the network, and it may be closed on a network thread in a context in which there's a risk of stack overflows if on close it calls back into the network layer in a manner that might end up nesting too deeply. When in doubt, dispatch any further work onto a separate thread.- Specified by:
decRefin interfaceRefCounted- Overrides:
decRefin classTransportMessage
-
hasReferences
public boolean hasReferences()- Specified by:
hasReferencesin interfaceRefCounted- Overrides:
hasReferencesin classTransportMessage
-
setLastChunkSequenceStart
public void setLastChunkSequenceStart(long sequenceStart) Sets the sequence start for the last chunk embedded in this result. Called on the data node after iterating fetch phase results.- Parameters:
sequenceStart- the sequence number of the first hit in the last chunk
-
getLastChunkSequenceStart
public long getLastChunkSequenceStart()Gets the sequence start for the last chunk embedded in this result. Used by the coordinator to properly order last chunk hits with other chunks.- Returns:
- the sequence number of the first hit in the last chunk, or -1 if not set
-
setLastChunkBytes
Sets the raw bytes of the last chunk. Called on the data node in chunked fetch mode to avoid deserializing large hit data that would cause OOM.Takes ownership of the bytes reference - caller must not release it.
- Parameters:
bytes- the serialized hit byteshitCount- the number of hits in the bytes
-
getLastChunkBytes
Gets the raw bytes of the last chunk. Used by the coordinator to deserialize and merge with other accumulated chunks.- Returns:
- the serialized hit bytes, or null if not set
-
getLastChunkHitCount
public int getLastChunkHitCount()Gets the number of hits in the last chunk bytes.- Returns:
- the hit count, or 0 if no last chunk
-