Search in sources :

Example 1 with ShardCollectSource

use of io.crate.operation.collect.sources.ShardCollectSource in project crate by crate.

the class ShardCollectorProviderTest method assertNoShardEntriesLeftInShardCollectSource.

public void assertNoShardEntriesLeftInShardCollectSource() throws Exception {
    final Field shards = ShardCollectSource.class.getDeclaredField("shards");
    shards.setAccessible(true);
    final List<ShardCollectSource> shardCollectSources = Lists.newArrayList((internalCluster().getInstances(ShardCollectSource.class)));
    for (ShardCollectSource shardCollectSource : shardCollectSources) {
        try {
            //noinspection unchecked
            Map<ShardId, ShardCollectorProvider> shardMap = (Map<ShardId, ShardCollectorProvider>) shards.get(shardCollectSource);
            assertThat(shardMap.size(), is(0));
        } catch (IllegalAccessException e) {
            Throwables.propagate(e);
        }
    }
}
Also used : ShardId(org.elasticsearch.index.shard.ShardId) Field(java.lang.reflect.Field) ShardCollectSource(io.crate.operation.collect.sources.ShardCollectSource) Map(java.util.Map)

Aggregations

ShardCollectSource (io.crate.operation.collect.sources.ShardCollectSource)1 Field (java.lang.reflect.Field)1 Map (java.util.Map)1 ShardId (org.elasticsearch.index.shard.ShardId)1