baseDir.mkdirs();
}
}
public boolean addIndex(Index index) {
IndexDescriptor desc = index.getIndexDescriptor();
if (!knownClusters.contains(desc.getClusterName())) {
return false;
}
// If there was an old copy of that index, delete it
Index oldFromSameCluster = indexes.get(desc.getClusterName());
if (null != oldFromSameCluster) {
logger.debug("erasing old index for cluster \"" + desc.getClusterName() + "\".");
oldFromSameCluster.eraseFromDisk();
}
// add it to current indexes
indexes.put(desc.getClusterName(),index);
// if we have a copy of each of this clusters, we can
// create a multi index.
if (indexes.size() == knownClusters.size()) {
Index[] toMerge = new Index[knownClusters.size()];