DocRouter docRouter = docCollection.getRouter();
SolrInputDocument doc = value.getSolrInputDocument();
String keyStr = key.toString();
// TODO: scalability: replace linear search in HashBasedRouter.hashToSlice() with binary search on sorted hash ranges
Slice slice = docRouter.getTargetSlice(keyStr, doc, emptySolrParams, docCollection);
// LOG.info("slice: {}", slice);
if (slice == null) {
throw new IllegalStateException("No matching slice found! The slice seems unavailable. docRouterClass: "
+ docRouter.getClass().getName());
}
int rootShard = shardNumbers.get(slice.getName());
if (rootShard < 0 || rootShard >= shards) {
throw new IllegalStateException("Illegal shard number " + rootShard + " for slice: " + slice + ", docCollection: "
+ docCollection);
}