Examples of CreateIndexResponse


Examples of com.dotcms.repackage.org.elasticsearch.action.admin.indices.create.CreateIndexResponse

    return createContentIndex(indexName, 0);
  }
  @Override
  public synchronized boolean createContentIndex(String indexName, int shards) throws ElasticSearchException, IOException {

    CreateIndexResponse cir = iapi.createIndex(indexName, null, shards);
    int i = 0;
    while(!cir.isAcknowledged()){

      try {
        Thread.sleep(100);
      } catch (InterruptedException e) {
        // TODO Auto-generated catch block
View Full Code Here

Examples of com.dotcms.repackage.org.elasticsearch.action.admin.indices.create.CreateIndexResponse

    iapi.delete(indexName);

    if(UtilMethods.isSet(indexName) && indexName.indexOf("sitesearch") > -1) {
      APILocator.getSiteSearchAPI().createSiteSearchIndex(indexName, alias, shards);
    } else {
      CreateIndexResponse res=createIndex(indexName, shards);

      try {
        int w=0;
        while(!res.isAcknowledged() && ++w<100)
          Thread.sleep(100);
      }
      catch(InterruptedException ex) {
        Logger.warn(this, ex.getMessage(), ex);
      }
View Full Code Here

Examples of com.dotcms.repackage.org.elasticsearch.action.admin.indices.create.CreateIndexResponse

    map.put("number_of_shards", shards);


        // create actual index
    CreateIndexRequestBuilder cirb = iac.prepareCreate(indexName).setSettings(map);
        CreateIndexResponse createIndexResponse = cirb.execute().actionGet();

        AdminLogger.log(this.getClass(), "createIndex",
                "Index created: " + indexName + " with shards: " + shards);

    return createIndexResponse;
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.create.CreateIndexResponse

        startNode("server1", settings);

        ClusterService clusterService1 = ((InternalNode) node("server1")).injector().getInstance(ClusterService.class);

        logger.info("Creating index [test]");
        CreateIndexResponse createIndexResponse = client("server1").admin().indices().create(createIndexRequest("test")).actionGet();
        assertThat(createIndexResponse.acknowledged(), equalTo(true));

        logger.info("Running Cluster Health");
        ClusterHealthResponse clusterHealth = client("server1").admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.create.CreateIndexResponse

        startNode("server1", settings);

        ClusterService clusterService1 = ((InternalNode) node("server1")).injector().getInstance(ClusterService.class);

        logger.info("Creating index [test]");
        CreateIndexResponse createIndexResponse = client("server1").admin().indices().create(createIndexRequest("test")).actionGet();
        assertThat(createIndexResponse.acknowledged(), equalTo(true));

        logger.info("Running Cluster Health");
        ClusterHealthResponse clusterHealth = client("server1").admin().cluster().health(clusterHealthRequest().waitForGreenStatus()).actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.create.CreateIndexResponse

        node.close();
    }

    @Test public void testHdfsGateway() throws Exception {
        // first, test meta data
        CreateIndexResponse createIndexResponse = node.client().admin().indices().create(createIndexRequest("test")).actionGet();
        assertThat(createIndexResponse.acknowledged(), equalTo(true));
        node.close();
        node = buildNode().start();

        logger.info("--> waiting for green status");
        ClusterHealthResponse health = node.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.create.CreateIndexResponse

        final String robotIndexName = SingletonS2Container
                .getComponent("robotIndexName");
        final IndicesExistsResponse indicesExistsResponse = client.admin()
                .indices().prepareExists(robotIndexName).execute().actionGet();
        if (!indicesExistsResponse.isExists()) {
            final CreateIndexResponse createIndexResponse = client.admin()
                    .indices().prepareCreate(robotIndexName).execute()
                    .actionGet();
            if (createIndexResponse.isAcknowledged()) {
                try {
                    createMapping(robotIndexName, "queue", createQueueMapping());
                    createMapping(robotIndexName, "filter",
                            createFilterMapping());
                    createMapping(robotIndexName, "data", createDataMapping());
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.create.CreateIndexResponse

    try {
     
      XContentBuilder settings = MappingUtil.getSettingsMapper(mapper);
     
      Logger.debug("Starting Elastic Search Index %s", indexName);
      CreateIndexResponse response = client.admin().indices()
          .create(new CreateIndexRequest(indexName)
          .settings(ImmutableSettings.settingsBuilder().loadFromSource(settings.string())))
          .actionGet();

      Logger.debug("Response: %s", response);
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.create.CreateIndexResponse

    }


    private void createIndexWithProductsMapping(String indexName) throws IOException {
        String settingsData = IOUtils.toString(this.getClass().getResourceAsStream("/product.json"));
        CreateIndexResponse createIndexResponse = client().admin().indices().prepareCreate(indexName)
                .setSource(settingsData).execute().actionGet();
        assertThat(createIndexResponse.isAcknowledged(), is(true));

        client().admin().cluster().prepareHealth(indexName).setWaitForGreenStatus().execute().actionGet();
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.create.CreateIndexResponse

      Settings settings = getStoreSettings(index);
      if (settings != null) {
        request.setSettings(settings);
      }

      CreateIndexResponse response = request
          .setTimeout(TimeValue.timeValueSeconds(INDEX_CREATION_TIMEOUT_SECONDS)).execute().actionGet();

      if (!response.isAcknowledged()) {
        log.warn("index creation not acknowledged within " + INDEX_CREATION_TIMEOUT_SECONDS + " seconds");
      }

      // TODO newly created. auto rebuild?
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.