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);
}
}
}
Aggregations