org.elasticsearch.cluster.ClusterState.prettyPrint()方法的使用及代码示例

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

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

ClusterState.prettyPrint介绍

暂无

代码示例

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

@Override
  public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
    try {
      listener.clusterStateProcessed(source, oldState, newState);
    } catch (Exception e) {
      logger.error(
        "exception thrown by listener while notifying of cluster state processed from [{}], old cluster state:\n{}\nnew cluster state:\n{}",
        e,
        source,
        oldState.prettyPrint(),
        newState.prettyPrint());
    }
  }
}

代码示例来源:origin: jprante/elasticsearch-gatherer

@Override
  public void clusterChanged(ClusterChangedEvent event) {
    logger.info("cluster changed {}", event.state().prettyPrint());

  }
}

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

@Override
  public void onFailure(String source, Throwable t) {
    rerouting.set(false);
    ClusterState state = clusterService.state();
    if (logger.isTraceEnabled()) {
      logger.error("unexpected failure during [{}], current state:\n{}", t, source, state.prettyPrint());
    } else {
      logger.error("unexpected failure during [{}], current state version [{}]", t, source, state.version());
    }
  }
});

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

rerouting.set(false);
ClusterState state = clusterService.state();
logger.warn("failed to reroute routing table, current state:\n{}", e, state.prettyPrint());

代码示例来源:origin: meltwater/elasticsearch-batch-percolator

/**
 * Ensures the cluster has a green state via the cluster health API. This method will also wait for relocations.
 * It is useful to ensure that all action on the cluster have finished and all shards that were currently relocating
 * are now allocated and started.
 */
public ClusterHealthStatus ensureGreen(Client client, String... indices) {
  ClusterHealthResponse actionGet = client.admin().cluster()
      .health(Requests.clusterHealthRequest(indices).waitForGreenStatus().waitForEvents(Priority.LANGUID).waitForRelocatingShards(0)).actionGet();
  if (actionGet.isTimedOut()) {
    logger.info("ensureGreen timed out, cluster state:\n{}\n{}", client.admin().cluster().prepareState().get().getState().prettyPrint(), client.admin().cluster().preparePendingClusterTasks().get().prettyPrint());
    assertThat("timed out waiting for green state", actionGet.isTimedOut(), equalTo(false));
  }
  assertThat(actionGet.getStatus(), equalTo(ClusterHealthStatus.GREEN));
  return actionGet.getStatus();
}

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

sb.append(newClusterState.prettyPrint());
  logger.trace(sb.toString());
} else if (logger.isDebugEnabled()) {

相关文章