org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.setStatus()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.setStatus()方法的一些代码示例,展示了ClusterHealthResponse.setStatus()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ClusterHealthResponse.setStatus()方法的具体详情如下:
包路径:org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse
类名称:ClusterHealthResponse
方法名:setStatus

ClusterHealthResponse.setStatus介绍

[英]Allows to explicitly override the derived cluster health status.
[中]允许显式覆盖派生群集运行状况状态。

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

waitForCounter++;
} catch (IndexNotFoundException e) {
  response.setStatus(ClusterHealthStatus.RED); // no indices, make sure its RED

代码示例来源:origin: org.elasticsearch/elasticsearch

private ClusterHealthResponse clusterHealth(ClusterHealthRequest request, ClusterState clusterState, int numberOfPendingTasks,
                        int numberOfInFlightFetch, TimeValue pendingTaskTimeInQueue) {
    if (logger.isTraceEnabled()) {
      logger.trace("Calculating health based on state version [{}]", clusterState.version());
    }

    String[] concreteIndices;
    try {
      concreteIndices = indexNameExpressionResolver.concreteIndexNames(clusterState, request);
    } catch (IndexNotFoundException e) {
      // one of the specified indices is not there - treat it as RED.
      ClusterHealthResponse response = new ClusterHealthResponse(clusterState.getClusterName().value(), Strings.EMPTY_ARRAY,
        clusterState, numberOfPendingTasks, numberOfInFlightFetch, UnassignedInfo.getNumberOfDelayedUnassigned(clusterState),
        pendingTaskTimeInQueue);
      response.setStatus(ClusterHealthStatus.RED);
      return response;
    }

    return new ClusterHealthResponse(clusterState.getClusterName().value(), concreteIndices, clusterState, numberOfPendingTasks,
        numberOfInFlightFetch, UnassignedInfo.getNumberOfDelayedUnassigned(clusterState), pendingTaskTimeInQueue);
  }
}

代码示例来源:origin: harbby/presto-connectors

waitForCounter++;
} catch (IndexNotFoundException e) {
  response.setStatus(ClusterHealthStatus.RED); // no indices, make sure its RED

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

waitForCounter++;
} catch (IndexNotFoundException e) {
  response.setStatus(ClusterHealthStatus.RED); // no indices, make sure its RED

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

waitForCounter++;
} catch (IndexNotFoundException e) {
  response.setStatus(ClusterHealthStatus.RED); // no indices, make sure its RED

代码示例来源:origin: apache/servicemix-bundles

waitForCounter++;
} catch (IndexNotFoundException e) {
  response.setStatus(ClusterHealthStatus.RED); // no indices, make sure its RED

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

private ClusterHealthResponse clusterHealth(ClusterHealthRequest request, ClusterState clusterState, int numberOfPendingTasks, int numberOfInFlightFetch,
                        TimeValue pendingTaskTimeInQueue) {
    if (logger.isTraceEnabled()) {
      logger.trace("Calculating health based on state version [{}]", clusterState.version());
    }

    String[] concreteIndices;
    try {
      concreteIndices = indexNameExpressionResolver.concreteIndexNames(clusterState, request);
    } catch (IndexNotFoundException e) {
      // one of the specified indices is not there - treat it as RED.
      ClusterHealthResponse response = new ClusterHealthResponse(clusterState.getClusterName().value(), Strings.EMPTY_ARRAY, clusterState,
          numberOfPendingTasks, numberOfInFlightFetch, UnassignedInfo.getNumberOfDelayedUnassigned(clusterState),
          pendingTaskTimeInQueue);
      response.setStatus(ClusterHealthStatus.RED);
      return response;
    }

    return new ClusterHealthResponse(clusterState.getClusterName().value(), concreteIndices, clusterState, numberOfPendingTasks,
        numberOfInFlightFetch, UnassignedInfo.getNumberOfDelayedUnassigned(clusterState), pendingTaskTimeInQueue);
  }
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

private ClusterHealthResponse clusterHealth(ClusterHealthRequest request, ClusterState clusterState, int numberOfPendingTasks, int numberOfInFlightFetch,
                        TimeValue pendingTaskTimeInQueue) {
    if (logger.isTraceEnabled()) {
      logger.trace("Calculating health based on state version [{}]", clusterState.version());
    }

    String[] concreteIndices;
    try {
      concreteIndices = indexNameExpressionResolver.concreteIndexNames(clusterState, request);
    } catch (IndexNotFoundException e) {
      // one of the specified indices is not there - treat it as RED.
      ClusterHealthResponse response = new ClusterHealthResponse(clusterState.getClusterName().value(), Strings.EMPTY_ARRAY, clusterState,
          numberOfPendingTasks, numberOfInFlightFetch, UnassignedInfo.getNumberOfDelayedUnassigned(clusterState),
          pendingTaskTimeInQueue);
      response.setStatus(ClusterHealthStatus.RED);
      return response;
    }

    return new ClusterHealthResponse(clusterState.getClusterName().value(), concreteIndices, clusterState, numberOfPendingTasks,
        numberOfInFlightFetch, UnassignedInfo.getNumberOfDelayedUnassigned(clusterState), pendingTaskTimeInQueue);
  }
}

代码示例来源:origin: apache/servicemix-bundles

private ClusterHealthResponse clusterHealth(ClusterHealthRequest request, ClusterState clusterState, int numberOfPendingTasks, int numberOfInFlightFetch,
                        TimeValue pendingTaskTimeInQueue) {
    if (logger.isTraceEnabled()) {
      logger.trace("Calculating health based on state version [{}]", clusterState.version());
    }

    String[] concreteIndices;
    try {
      concreteIndices = indexNameExpressionResolver.concreteIndexNames(clusterState, request);
    } catch (IndexNotFoundException e) {
      // one of the specified indices is not there - treat it as RED.
      ClusterHealthResponse response = new ClusterHealthResponse(clusterState.getClusterName().value(), Strings.EMPTY_ARRAY, clusterState,
          numberOfPendingTasks, numberOfInFlightFetch, UnassignedInfo.getNumberOfDelayedUnassigned(clusterState),
          pendingTaskTimeInQueue);
      response.setStatus(ClusterHealthStatus.RED);
      return response;
    }

    return new ClusterHealthResponse(clusterState.getClusterName().value(), concreteIndices, clusterState, numberOfPendingTasks,
        numberOfInFlightFetch, UnassignedInfo.getNumberOfDelayedUnassigned(clusterState), pendingTaskTimeInQueue);
  }
}

代码示例来源:origin: harbby/presto-connectors

private ClusterHealthResponse clusterHealth(ClusterHealthRequest request, ClusterState clusterState, int numberOfPendingTasks, int numberOfInFlightFetch,
                        TimeValue pendingTaskTimeInQueue) {
    if (logger.isTraceEnabled()) {
      logger.trace("Calculating health based on state version [{}]", clusterState.version());
    }

    String[] concreteIndices;
    try {
      concreteIndices = indexNameExpressionResolver.concreteIndices(clusterState, request);
    } catch (IndexNotFoundException e) {
      // one of the specified indices is not there - treat it as RED.
      ClusterHealthResponse response = new ClusterHealthResponse(clusterName.value(), Strings.EMPTY_ARRAY, clusterState,
          numberOfPendingTasks, numberOfInFlightFetch, UnassignedInfo.getNumberOfDelayedUnassigned(clusterState),
          pendingTaskTimeInQueue);
      response.setStatus(ClusterHealthStatus.RED);
      return response;
    }

    return new ClusterHealthResponse(clusterName.value(), concreteIndices, clusterState, numberOfPendingTasks,
        numberOfInFlightFetch, UnassignedInfo.getNumberOfDelayedUnassigned(clusterState), pendingTaskTimeInQueue);
  }
}

相关文章

微信公众号

最新文章

更多