Examples of firstOrNull()


Examples of org.elasticsearch.cluster.routing.ShardIterator.firstOrNull()

        ShardIterator shardIterator = routingTable.index("test1").shard(0).shardsIt(0);
        assertThat(shardIterator.size(), equalTo(3));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.remaining(), equalTo(3));
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        assertThat(shardIterator.remaining(), equalTo(3));
        ShardRouting shardRouting1 = shardIterator.nextOrNull();
        assertThat(shardRouting1, notNullValue());
        assertThat(shardIterator.remaining(), equalTo(2));
        ShardRouting shardRouting2 = shardIterator.nextOrNull();
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardIterator.firstOrNull()

                .add(indexRoutingTable("test2").initializeEmpty(metaData.index("test2")))
                .build();

        ShardIterator shardIterator = routingTable.index("test1").shard(0).shardsIt(0);
        assertThat(shardIterator.size(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.remaining(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        assertThat(shardIterator.remaining(), equalTo(2));
        ShardRouting shardRouting1 = shardIterator.nextOrNull();
        assertThat(shardRouting1, notNullValue());
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardIterator.firstOrNull()

        ShardIterator shardIterator = routingTable.index("test1").shard(0).shardsIt(0);
        assertThat(shardIterator.size(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.remaining(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        assertThat(shardIterator.remaining(), equalTo(2));
        ShardRouting shardRouting1 = shardIterator.nextOrNull();
        assertThat(shardRouting1, notNullValue());
        assertThat(shardIterator.remaining(), equalTo(1));
        ShardRouting shardRouting2 = shardIterator.nextOrNull();
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardIterator.firstOrNull()

        ShardIterator shardIterator = routingTable.index("test1").shard(0).shardsIt(0);
        assertThat(shardIterator.size(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.remaining(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        assertThat(shardIterator.remaining(), equalTo(2));
        ShardRouting shardRouting1 = shardIterator.nextOrNull();
        assertThat(shardRouting1, notNullValue());
        assertThat(shardIterator.remaining(), equalTo(1));
        ShardRouting shardRouting2 = shardIterator.nextOrNull();
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardIterator.firstOrNull()

        assertThat(shardIterator.nextOrNull(), nullValue());
        assertThat(shardIterator.remaining(), equalTo(0));

        shardIterator = routingTable.index("test1").shard(0).shardsIt(1);
        assertThat(shardIterator.size(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        ShardRouting shardRouting3 = shardIterator.nextOrNull();
        assertThat(shardRouting1, notNullValue());
        ShardRouting shardRouting4 = shardIterator.nextOrNull();
        assertThat(shardRouting2, notNullValue());
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardIterator.firstOrNull()

        assertThat(shardIterator.remaining(), equalTo(0));

        shardIterator = routingTable.index("test1").shard(0).shardsIt(1);
        assertThat(shardIterator.size(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        ShardRouting shardRouting3 = shardIterator.nextOrNull();
        assertThat(shardRouting1, notNullValue());
        ShardRouting shardRouting4 = shardIterator.nextOrNull();
        assertThat(shardRouting2, notNullValue());
        assertThat(shardRouting2, not(sameInstance(shardRouting1)));
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardIterator.firstOrNull()

        assertThat(shardIterator.remaining(), equalTo(0));

        shardIterator = routingTable.index("test1").shard(0).shardsIt(1);
        assertThat(shardIterator.size(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        ShardRouting shardRouting3 = shardIterator.nextOrNull();
        assertThat(shardRouting1, notNullValue());
        ShardRouting shardRouting4 = shardIterator.nextOrNull();
        assertThat(shardRouting2, notNullValue());
        assertThat(shardRouting2, not(sameInstance(shardRouting1)));
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardIterator.firstOrNull()

        assertThat(shardRouting1, sameInstance(shardRouting4));
        assertThat(shardRouting2, sameInstance(shardRouting3));

        shardIterator = routingTable.index("test1").shard(0).shardsIt(2);
        assertThat(shardIterator.size(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        ShardRouting shardRouting5 = shardIterator.nextOrNull();
        assertThat(shardRouting5, notNullValue());
        ShardRouting shardRouting6 = shardIterator.nextOrNull();
        assertThat(shardRouting6, notNullValue());
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardIterator.firstOrNull()

        assertThat(shardRouting2, sameInstance(shardRouting3));

        shardIterator = routingTable.index("test1").shard(0).shardsIt(2);
        assertThat(shardIterator.size(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        ShardRouting shardRouting5 = shardIterator.nextOrNull();
        assertThat(shardRouting5, notNullValue());
        ShardRouting shardRouting6 = shardIterator.nextOrNull();
        assertThat(shardRouting6, notNullValue());
        assertThat(shardRouting6, not(sameInstance(shardRouting5)));
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardIterator.firstOrNull()

        assertThat(shardRouting2, sameInstance(shardRouting3));

        shardIterator = routingTable.index("test1").shard(0).shardsIt(2);
        assertThat(shardIterator.size(), equalTo(2));
        assertThat(shardIterator.firstOrNull(), notNullValue());
        assertThat(shardIterator.firstOrNull(), sameInstance(shardIterator.firstOrNull()));
        ShardRouting shardRouting5 = shardIterator.nextOrNull();
        assertThat(shardRouting5, notNullValue());
        ShardRouting shardRouting6 = shardIterator.nextOrNull();
        assertThat(shardRouting6, notNullValue());
        assertThat(shardRouting6, not(sameInstance(shardRouting5)));
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.