Class EsqlCCSUtils
java.lang.Object
org.elasticsearch.xpack.esql.session.EsqlCCSUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck whether this exception can be tolerated when partial results are on, or should be treated as fatal.static voidfinalizeSubPlanOnlyRemoteClusters(EsqlExecutionInfo executionInfo) Finalize remote clusters that were only involved in sub-plan execution (e.g.static StringinClusterName(String clusterAlias) static voidinitCrossClusterState(IndicesExpressionGrouper indicesGrouper, XPackLicenseState licenseState, Set<IndexPattern> indexPatterns, EsqlExecutionInfo executionInfo) Checks the index expression for the presence of remote clusters.static voidinitCrossClusterState(IndexResolution resolution, EsqlExecutionInfo executionInfo) static voidmarkClusterWithFinalStateAndNoShards(EsqlExecutionInfo executionInfo, String clusterAlias, EsqlExecutionInfo.Cluster.Status status, Exception ex) Mark cluster with a final status (success or failure).static voidvalidateCcsLicense(XPackLicenseState licenseState, EsqlExecutionInfo executionInfo)
-
Method Details
-
initCrossClusterState
public static void initCrossClusterState(IndicesExpressionGrouper indicesGrouper, XPackLicenseState licenseState, Set<IndexPattern> indexPatterns, EsqlExecutionInfo executionInfo) throws ElasticsearchStatusException Checks the index expression for the presence of remote clusters. If found, it will ensure that the caller has a valid Enterprise (or Trial) license on the querying cluster as well as initialize the corresponding cluster state in execution info.- Throws:
ElasticsearchStatusException- if the license is not valid (or present) for ES|QL CCS search.
-
validateCcsLicense
public static void validateCcsLicense(XPackLicenseState licenseState, EsqlExecutionInfo executionInfo) -
initCrossClusterState
public static void initCrossClusterState(IndexResolution resolution, EsqlExecutionInfo executionInfo) -
finalizeSubPlanOnlyRemoteClusters
Finalize remote clusters that were only involved in sub-plan execution (e.g. an IN-subquery running on a remote cluster while the outer FROM is local). During sub-plan execution,ClusterComputeHandler.updateExecutionInfoaccumulates shard counts and took time but never advances a cluster's status pastRUNNINGbecauseisMainPlan()isfalse. After the main plan completes, any cluster still inRUNNINGstate was not touched by the main plan; set its final status based on accumulated failures from the sub-plan (PARTIAL if there were failures, SUCCESSFUL otherwise). -
markClusterWithFinalStateAndNoShards
public static void markClusterWithFinalStateAndNoShards(EsqlExecutionInfo executionInfo, String clusterAlias, EsqlExecutionInfo.Cluster.Status status, @Nullable Exception ex) Mark cluster with a final status (success or failure). Most metrics are set to 0 if not set yet, except for "took" which is set to the total time taken so far. The status must be the final status of the cluster, not RUNNING. -
canAllowPartial
Check whether this exception can be tolerated when partial results are on, or should be treated as fatal.- Returns:
- true if the exception can be tolerated, false if it should be treated as fatal.
-
inClusterName
-