Class EsqlExecutionInfo
java.lang.Object
org.elasticsearch.xpack.esql.action.EsqlExecutionInfo
- All Implemented Interfaces:
Writeable,ChunkedToXContent,ChunkedToXContentObject
Holds execution metadata about ES|QL queries for cross-cluster searches in order to display
this information in ES|QL JSON responses.
Patterned after the SearchResponse.Clusters and SearchResponse.Cluster classes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the search metadata about a particular cluster involved in a cross-cluster search.Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Map<String, EsqlExecutionInfo.Cluster> static final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final Stringstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionEsqlExecutionInfo(boolean includeCCSMetadata) EsqlExecutionInfo(Predicate<String> skipUnavailablePredicate, boolean includeCCSMetadata) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetCluster(String clusterAlias) intinthashCode()booleanIs there any metadata to report in the response? This is true on cross-cluster search with includeCCSMetadata=true or when there are partial failures.booleanbooleanbooleanbooleanisSkipUnavailable(String clusterAlias) booleanvoidvoidCall when ES|QL "planning" phase is complete and query execution (in ComputeService) is about to start.voidCall when ES|QL execution is complete in order to set the overall took time for an ES|QL query.org.elasticsearch.core.TimeValueorg.elasticsearch.core.TimeValueswapCluster(String clusterAlias, BiFunction<String, EsqlExecutionInfo.Cluster, EsqlExecutionInfo.Cluster> remappingFunction) Utility to swap a Cluster object.org.elasticsearch.core.TimeValueHow much time the query took since starting.toString()Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
toXContentChunkedV7Methods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContentObject
isFragment
-
Field Details
-
LOCAL_CLUSTER_NAME_REPRESENTATION
- See Also:
-
TOTAL_FIELD
public static final org.elasticsearch.xcontent.ParseField TOTAL_FIELD -
SUCCESSFUL_FIELD
public static final org.elasticsearch.xcontent.ParseField SUCCESSFUL_FIELD -
SKIPPED_FIELD
public static final org.elasticsearch.xcontent.ParseField SKIPPED_FIELD -
RUNNING_FIELD
public static final org.elasticsearch.xcontent.ParseField RUNNING_FIELD -
PARTIAL_FIELD
public static final org.elasticsearch.xcontent.ParseField PARTIAL_FIELD -
FAILED_FIELD
public static final org.elasticsearch.xcontent.ParseField FAILED_FIELD -
DETAILS_FIELD
public static final org.elasticsearch.xcontent.ParseField DETAILS_FIELD -
TOOK
public static final org.elasticsearch.xcontent.ParseField TOOK -
IS_PARTIAL_FIELD
public static final org.elasticsearch.xcontent.ParseField IS_PARTIAL_FIELD -
clusterInfo
-
-
Constructor Details
-
EsqlExecutionInfo
public EsqlExecutionInfo(boolean includeCCSMetadata) -
EsqlExecutionInfo
- Parameters:
skipUnavailablePredicate- provide lookup for whether a given cluster has skip_unavailable set to true or falseincludeCCSMetadata- (user defined setting) whether to include the CCS metadata in the HTTP response
-
EsqlExecutionInfo
- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
includeCCSMetadata
public boolean includeCCSMetadata() -
markEndPlanning
public void markEndPlanning()Call when ES|QL "planning" phase is complete and query execution (in ComputeService) is about to start. Note this is currently only built for a single phase planning/execution model. When INLINESTATS moves towards GA we may need to revisit this model. Currently, it should never be called more than once. -
planningTookTime
public org.elasticsearch.core.TimeValue planningTookTime() -
markEndQuery
public void markEndQuery()Call when ES|QL execution is complete in order to set the overall took time for an ES|QL query. -
overallTook
public org.elasticsearch.core.TimeValue overallTook() -
tookSoFar
public org.elasticsearch.core.TimeValue tookSoFar()How much time the query took since starting. -
overallTimeSpan
-
planningTimeSpan
-
clusterAliases
-
isCrossClusterSearch
public boolean isCrossClusterSearch() -
hasMetadataToReport
public boolean hasMetadataToReport()Is there any metadata to report in the response? This is true on cross-cluster search with includeCCSMetadata=true or when there are partial failures. -
getCluster
-
getClusters
-
swapCluster
public EsqlExecutionInfo.Cluster swapCluster(String clusterAlias, BiFunction<String, EsqlExecutionInfo.Cluster, EsqlExecutionInfo.Cluster> remappingFunction) Utility to swap a Cluster object. Guidelines for the remapping function:- The remapping function should return a new Cluster object to swap it for the existing one.
- If in the remapping function you decide to abort the swap you must return the original Cluster object to keep the map unchanged.
- Do not return
null. If the remapping function returnsnull, the mapping is removed (or remains absent if initially absent). - If the remapping function itself throws an (unchecked) exception, the exception is rethrown, and the current mapping is left unchanged. Throwing exception therefore is OK, but it is generally discouraged.
- The remapping function may be called multiple times in a CAS fashion underneath, make sure that is safe to do so.
- Parameters:
clusterAlias- key with which the specified value is associatedremappingFunction- function to swap the oldCluster to a newCluster- Returns:
- the new Cluster object
-
toXContentChunked
public Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params params) - Specified by:
toXContentChunkedin interfaceChunkedToXContent
-
getClusterStateCount
- Parameters:
status- the status you want a count of- Returns:
- how many clusters are currently in a specific state
-
getClusterStates
- Parameters:
status- the status you want to access- Returns:
- a stream of clusters with that status
-
toString
-
equals
-
hashCode
public int hashCode() -
isPartial
public boolean isPartial() -
markAsStopped
public void markAsStopped() -
isStopped
public boolean isStopped()
-