Class EsqlCCSUtils

java.lang.Object
org.elasticsearch.xpack.esql.session.EsqlCCSUtils

public class EsqlCCSUtils extends Object
  • 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

      public static void finalizeSubPlanOnlyRemoteClusters(EsqlExecutionInfo executionInfo)
      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.updateExecutionInfo accumulates shard counts and took time but never advances a cluster's status past RUNNING because isMainPlan() is false. After the main plan completes, any cluster still in RUNNING state 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

      public static boolean canAllowPartial(Exception e)
      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

      public static String inClusterName(String clusterAlias)