Examples of execute()


Examples of org.elasticsearch.action.admin.cluster.state.ClusterStateRequestBuilder.execute()

    }

    @Override
    public String getPoolUUID(String pool) {
        ClusterStateRequestBuilder builder = client.admin().cluster().prepareState();
        ClusterStateResponse response = builder.execute().actionGet();
        ClusterName name = response.getClusterName();
        return UUID.nameUUIDFromBytes(name.toString().getBytes()).toString().replace("-", "");
    }

    @Override
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequestBuilder.execute()

            System.out.println("Adding " + diff + " more aliases to get to the start amount of " + BASE_ALIAS_COUNT + " aliases");
            IndicesAliasesRequestBuilder builder = client.admin().indices().prepareAliases();
            for (int i = 1; i <= diff; i++) {
                builder.addAlias(INDEX_NAME, Strings.randomBase64UUID());
                if (i % 1000 == 0) {
                    builder.execute().actionGet();
                    builder = client.admin().indices().prepareAliases();
                }
            }
            if (!builder.request().getAliasActions().isEmpty()) {
                builder.execute().actionGet();
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder.execute()

      CreateIndexRequestBuilder create = getClient().admin().indices().prepareCreate(name).
          setSettings(nb.settings().build());

      // default system mapping (all the rest are dynamic)
      create.addMapping("_default_", getDefaultMapping());
      create.execute().actionGet();

      addIndexAlias(name, appid);
    } catch (Exception e) {
      logger.warn(null, e);
      return false;
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequestBuilder.execute()

    @Override
    public String databaseExists(String database) {
        String index = getElasticSearchIndexNameFromDatabase(database);
        IndicesExistsRequestBuilder existsBuilder = client.admin().indices().prepareExists(index);
        IndicesExistsResponse response = existsBuilder.execute().actionGet();
        if(response.isExists()) {
            String uuid = getBucketUUIDFromDatabase(database);
            if(uuid != null) {
                logger.debug("included uuid, validating");
                String actualUUID = getBucketUUID("default", index);
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder.execute()

            //Put the schema/mapping
            log.info("Put Mapping for ["+indexName+"]/["+indexType+"]="+stringMappingJSON);
            PutMappingRequestBuilder putMappingRequestBuilder = client.admin().indices().preparePutMapping(indexName).setType(indexType);
            putMappingRequestBuilder.setSource(stringMappingJSON);
            PutMappingResponse response = putMappingRequestBuilder.execute().actionGet();

            if(!response.isAcknowledged()) {
                log.info("Could not define mapping for type ["+indexName+"]/["+indexType+"]");
            } else {
                log.info("Successfully put mapping for ["+indexName+"]/["+indexType+"]");
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequestBuilder.execute()

        HashMap<String, Object> newSettings = new HashMap<>();
        newSettings.put(IndexMetaData.SETTING_READ_ONLY, value);

        UpdateSettingsRequestBuilder settingsRequest = client().admin().indices().prepareUpdateSettings(index);
        settingsRequest.setSettings(newSettings);
        UpdateSettingsResponse settingsResponse = settingsRequest.execute().actionGet();
        assertThat(settingsResponse, notNullValue());
    }
}
View Full Code Here

Examples of org.elasticsearch.action.bulk.BulkRequestBuilder.execute()

          sinkCounter.incrementBatchCompleteCount();
        }

        sinkCounter.addToEventDrainAttemptCount(size);

        BulkResponse bulkResponse = bulkRequest.execute().actionGet();
        if (bulkResponse.hasFailures()) {
          throw new EventDeliveryException(bulkResponse.buildFailureMessage());
        }
      }
      txn.commit();
View Full Code Here

Examples of org.elasticsearch.action.count.CountRequestBuilder.execute()

    if (type != null) {
      crb.setTypes(type);
    }

    return crb.execute().actionGet().getCount();
  }

  @Override
  public Long getCount(String appid, String type, Map<String, ?> terms) {
    if (StringUtils.isBlank(appid) || terms == null || terms.isEmpty()) {
View Full Code Here

Examples of org.elasticsearch.action.delete.DeleteRequestBuilder.execute()

    try {
      DeleteRequestBuilder builder = client.prepareDelete();
      builder.setIndex(defaultIndex);
      builder.setType("doc");
      builder.setId(key);
      builder.execute().actionGet();
    } catch (ElasticsearchException e) {
      throw makeIOException(e);
    }
  }
View Full Code Here

Examples of org.elasticsearch.action.deletebyquery.DeleteByQueryRequestBuilder.execute()

        querySource.put(columnName, columnValue);

        DeleteByQueryRequestBuilder deleteQueryBuilder = txClient.prepareDeleteByQuery(schemaName.toLowerCase())
                .setQuery(querySource).setTypes(tableName);

        deleteQueryBuilder.execute().actionGet();
    }

    @Override
    public List<Object> findByRelation(String colName, Object colValue, Class entityClazz)
    {
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.