Examples of indices()


Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.indices()

        logger.info("--> done cluster health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.indices().get("test").activePrimaryShards(), equalTo(2));
        assertThat(clusterHealth.indices().get("test").numberOfReplicas(), equalTo(1));
        assertThat(clusterHealth.indices().get("test").activeShards(), equalTo(4));

        logger.info("--> add another node, should increase the number of replicas");
        startNode("node3");

        logger.info("--> running cluster health");
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.indices()

        logger.info("--> running cluster health");
        clusterHealth = client1.admin().cluster().prepareHealth().setWaitForGreenStatus().setWaitForActiveShards(6).execute().actionGet();
        logger.info("--> done cluster health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.indices().get("test").activePrimaryShards(), equalTo(2));
        assertThat(clusterHealth.indices().get("test").numberOfReplicas(), equalTo(2));
        assertThat(clusterHealth.indices().get("test").activeShards(), equalTo(6));

        logger.info("--> closing one node");
        closeNode("node3");
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.indices()

        clusterHealth = client1.admin().cluster().prepareHealth().setWaitForGreenStatus().setWaitForActiveShards(6).execute().actionGet();
        logger.info("--> done cluster health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.indices().get("test").activePrimaryShards(), equalTo(2));
        assertThat(clusterHealth.indices().get("test").numberOfReplicas(), equalTo(2));
        assertThat(clusterHealth.indices().get("test").activeShards(), equalTo(6));

        logger.info("--> closing one node");
        closeNode("node3");
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.indices()

        logger.info("--> done cluster health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.indices().get("test").activePrimaryShards(), equalTo(2));
        assertThat(clusterHealth.indices().get("test").numberOfReplicas(), equalTo(2));
        assertThat(clusterHealth.indices().get("test").activeShards(), equalTo(6));

        logger.info("--> closing one node");
        closeNode("node3");

        logger.info("--> running cluster health");
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.indices()

        logger.info("--> running cluster health");
        clusterHealth = client1.admin().cluster().prepareHealth().setWaitForGreenStatus().setWaitForActiveShards(4).execute().actionGet();
        logger.info("--> done cluster health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.indices().get("test").activePrimaryShards(), equalTo(2));
        assertThat(clusterHealth.indices().get("test").numberOfReplicas(), equalTo(1));
        assertThat(clusterHealth.indices().get("test").activeShards(), equalTo(4));

        logger.info("--> closing another node");
        closeNode("node2");
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest.indices()

        NodesStatsRequest nodesStatsRequest = new NodesStatsRequest(nodesIds);
        nodesStatsRequest.listenerThreaded(false);

        if (metrics.size() == 1 && metrics.contains("_all")) {
            nodesStatsRequest.all();
            nodesStatsRequest.indices(CommonStatsFlags.ALL);
        } else {
            nodesStatsRequest.clear();
            nodesStatsRequest.os(metrics.contains("os"));
            nodesStatsRequest.jvm(metrics.contains("jvm"));
            nodesStatsRequest.threadPool(metrics.contains("thread_pool"));
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.ping.replication.ReplicationPingResponse.indices()

        assertThat(broadcastResponse.successfulShards(), equalTo(5));
        assertThat(broadcastResponse.failedShards(), equalTo(0));

        logger.info("Replication pinging test1 and test2");
        ReplicationPingResponse replicationResponse = client("server1").admin().cluster().ping(pingReplicationRequest("test1", "test2")).actionGet();
        assertThat(replicationResponse.indices().size(), equalTo(2));
        assertThat(replicationResponse.index("test1").successfulShards(), equalTo(5));
        assertThat(replicationResponse.index("test1").failedShards(), equalTo(0));
    }
}
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.state.ClusterStateRequest.indices()

        clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout()));

        final String[] indices = Strings.splitStringByCommaToArray(request.param("indices", "_all"));
        boolean isAllIndicesOnly = indices.length == 1 && "_all".equals(indices[0]);
        if (!isAllIndicesOnly) {
            clusterStateRequest.indices(indices);
        }

        if (request.hasParam("metric")) {
            EnumSet<ClusterState.Metric> metrics = ClusterState.Metric.parseString(request.param("metric"), true);
            // do not ask for what we do not need.
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest.indices()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        final String[] aliases = request.paramAsStringArrayOrEmptyIfAll("name");
        final String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
        final GetAliasesRequest getAliasesRequest = new GetAliasesRequest(aliases);
        getAliasesRequest.indices(indices);
        getAliasesRequest.indicesOptions(IndicesOptions.fromRequest(request, getAliasesRequest.indicesOptions()));
        getAliasesRequest.local(request.paramAsBoolean("local", getAliasesRequest.local()));

        client.admin().indices().getAliases(getAliasesRequest, new RestBuilderListener<GetAliasesResponse>(channel) {
            @Override
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.get.GetIndexRequest.indices()

        if (features == null && indices.length > 0 && indices[0] != null && indices[0].startsWith("_") && !"_all".equals(indices[0])) {
            features = indices;
            indices = new String[] {"_all"};
        }
        final GetIndexRequest getIndexRequest = new GetIndexRequest();
        getIndexRequest.indices(indices);
        if (features != null) {
            getIndexRequest.features(features);
        }
        getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions()));
        getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local()));
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.