Package org.elasticsearch.action.admin.indices.optimize

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


    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

    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

    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

    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

    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

    /**
     * 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

    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

        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

Related Classes of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse

Copyright © 2018 www.massapicom. 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.