Map<String, BlurIndex> indexes = oldIndexesThatNeedToBeClosed.get(table);
if (indexes == null) {
continue;
}
for (String shard : indexes.keySet()) {
BlurIndex index = indexes.get(shard);
if (index == null) {
continue;
}
close(index, table, shard);
closed = true;
}
}
for (String table : _indexes.keySet()) {
Map<String, BlurIndex> shardMap = _indexes.get(table);
if (shardMap != null) {
Set<String> shards = new HashSet<String>(shardMap.keySet());
Set<String> shardsToServe = getShardsToServe(table);
shards.removeAll(shardsToServe);
if (!shards.isEmpty()) {
LOG.info("Need to close indexes for table [{0}] indexes [{1}]", table, shards);
}
for (String shard : shards) {
LOG.info("Closing index for table [{0}] shard [{1}]", table, shard);
BlurIndex index = shardMap.remove(shard);
close(index, table, shard);
closed = true;
}
}
if (closed) {