Package org.elasticsearch.action.admin.indices.alias

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


                    builder.execute().actionGet();
                    builder = client.admin().indices().prepareAliases();
                }
            }
            if (!builder.request().getAliasActions().isEmpty()) {
                builder.execute().actionGet();
            }
        } else if (numberOfAliases > BASE_ALIAS_COUNT) {
            IndicesAliasesRequestBuilder builder = client.admin().indices().prepareAliases();
            int diff = numberOfAliases - BASE_ALIAS_COUNT;
            System.out.println("Removing " + diff + " aliases to get to the start amount of " + BASE_ALIAS_COUNT + " aliases");
View Full Code Here

                    .addIndices(INDEX_NAME)
                    .execute().actionGet().getAliases().get(INDEX_NAME);
            for (int i = 0; i <= diff; i++) {
                builder.removeAlias(INDEX_NAME, aliases.get(i).alias());
                if (i % 1000 == 0) {
                    builder.execute().actionGet();
                    builder = client.admin().indices().prepareAliases();
                }
            }
            if (!builder.request().getAliasActions().isEmpty()) {
                builder.execute().actionGet();
View Full Code Here

                    builder.execute().actionGet();
                    builder = client.admin().indices().prepareAliases();
                }
            }
            if (!builder.request().getAliasActions().isEmpty()) {
                builder.execute().actionGet();
            }
        }

        numberOfAliases = countAliases(client);
        System.out.println("Number of aliases: " + numberOfAliases);
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.