use of com.torodb.mongodb.commands.pojos.index.IndexOptions in project torodb by torodb.
the class AkkaDbCloner method getIndexesToClone.
private List<IndexOptions> getIndexesToClone(List<IndexOptions> listindexes, String toDb, String toCol, String fromCol, String fromDb, CloneOptions opts) {
List<IndexOptions> indexesToClone = new ArrayList<>();
for (Iterator<IndexOptions> iterator = listindexes.iterator(); iterator.hasNext(); ) {
IndexOptions indexEntry = iterator.next();
if (!opts.getIndexFilter().test(toCol, indexEntry.getName(), indexEntry.isUnique(), indexEntry.getKeys())) {
LOGGER.info("Not cloning index {}.{} because it didn't pass the given filter predicate", toCol, indexEntry.getName());
continue;
}
LOGGER.info("Index {}.{}.{} will be cloned", fromDb, fromCol, indexEntry.getName());
indexesToClone.add(indexEntry);
}
return indexesToClone;
}
Aggregations