Examples of OptimizeResponse


Examples of com.dotcms.repackage.org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

    try {
      IndicesAdminClient iac = new ESClient().getClient().admin().indices();

      OptimizeRequest req = new OptimizeRequest(indexNames.toArray(new String[indexNames.size()]));

      OptimizeResponse res = iac.optimize(req).get();

      Logger.info(this.getClass(), "Optimizing " + indexNames + " :" + res.getSuccessfulShards() + "/" + res.getTotalShards()
          + " shards optimized");
      return true;
    } catch (Exception e) {
      throw new ElasticSearchException(e.getMessage());
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

        ClearIndicesCacheResponse clearIndicesCacheResponse = client1.admin().indices().clearCache(clearIndicesCacheRequest("test")).actionGet();
        assertThat(clearIndicesCacheResponse.successfulShards(), equalTo(10));
        assertThat(clearIndicesCacheResponse.failedShards(), equalTo(0));

        logger.info("Optimizing");
        OptimizeResponse optimizeResponse = client1.admin().indices().prepareOptimize("test").execute().actionGet();
        assertThat(optimizeResponse.successfulShards(), equalTo(10));
        assertThat(optimizeResponse.failedShards(), equalTo(0));

        GetResponse getResult;

        logger.info("Get [type1/1]");
        for (int i = 0; i < 5; i++) {
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

    if (StringUtils.isBlank(appid)) {
      return false;
    }
    boolean result = false;
    try {
      OptimizeResponse resp = getClient().admin().indices().
          prepareOptimize(appid).execute().actionGet();

      result = resp.getFailedShards() == 0;
    } catch (Exception e) {
      logger.warn(null, e);
    }
    return result;
  }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

    public void start(Map<String, String> map) throws Exception {
        String argStr = map.get("optimize");
        if (argStr != null) {
            int segments = 1;
            logger.info("Start optimizing for twindex");
            OptimizeResponse rsp = tweetSearch.optimize(tweetSearch.getIndexName(), segments);
            logger.info("Optimized twindex to " + segments + " segments for " + rsp.getSuccessfulShards() + "/" + rsp.getTotalShards() + " shards.\n Now uindex");
            rsp = tweetSearch.optimize(tweetSearch.getIndexName(), segments);
            logger.info("Optimized uindex  to " + segments + " segments for " + rsp.getSuccessfulShards() + "/" + rsp.getTotalShards() + " shards.");
        }

        argStr = map.get("listTweets");
        if (argStr != null) {
            if ("true".equals(argStr))
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

    if (StringUtils.isBlank(appid)) {
      return false;
    }
    boolean result = false;
    try {
      OptimizeResponse resp = getClient().admin().indices().
          prepareOptimize(appid).execute().actionGet();

      result = resp.getFailedShards() == 0;
    } catch (Exception e) {
      logger.warn(null, e);
    }
    return result;
  }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

    if (StringUtils.isBlank(appid)) {
      return false;
    }
    boolean result = false;
    try {
      OptimizeResponse resp = getClient().admin().indices().
          prepareOptimize(appid).execute().actionGet();

      result = resp.getFailedShards() == 0;
    } catch (Exception e) {
      logger.warn(null, e);
    }
    return result;
  }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

    if (StringUtils.isBlank(appid)) {
      return false;
    }
    boolean result = false;
    try {
      OptimizeResponse resp = getClient().admin().indices().
          prepareOptimize(appid).execute().actionGet();

      result = resp.getFailedShards() == 0;
    } catch (Exception e) {
      logger.warn(null, e);
    }
    return result;
  }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

    /**
     * Waits for all relocations and optimized all indices in the cluster to 1 segment.
     */
    protected OptimizeResponse optimize() {
        waitForRelocation();
        OptimizeResponse actionGet = client().admin().indices().prepareOptimize().execute().actionGet();
        assertNoFailures(actionGet);
        return actionGet;
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

    if (StringUtils.isBlank(appid)) {
      return false;
    }
    boolean result = false;
    try {
      OptimizeResponse resp = getClient().admin().indices().
          prepareOptimize(appid).execute().actionGet();

      result = resp.getFailedShards() == 0;
    } catch (Exception e) {
      logger.warn(null, e);
    }
    return result;
  }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

        assertNoFailures(clearIndicesCacheResponse);
        assertThat(clearIndicesCacheResponse.getSuccessfulShards(), equalTo(numShards.totalNumShards));

        logger.info("Optimizing");
        waitForRelocation(ClusterHealthStatus.GREEN);
        OptimizeResponse optimizeResponse = optimize();
        assertThat(optimizeResponse.getSuccessfulShards(), equalTo(numShards.totalNumShards));

        GetResponse getResult;

        logger.info("Get [type1/1]");
        for (int i = 0; i < 5; i++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.