@Override
public void createIndexes(Session session, Collection<? extends Index> indexes, boolean keepStorage) {
ArgumentValidation.notNull("indexes", indexes);
ArgumentValidation.notEmpty("indexes", indexes);
AISMerge merge = AISMerge.newForAddIndex(aisCloner, getNameGenerator(session), getAISForChange(session));
Set<String> schemas = new HashSet<>();
Collection<Integer> tableIDs = new HashSet<>(indexes.size());
for(Index proposed : indexes) {
Index newIndex = merge.mergeIndex(proposed);
if(keepStorage && (proposed.getStorageDescription() != null)) {
newIndex.copyStorageDescription(proposed);
}
tableIDs.addAll(newIndex.getAllTableIDs());
schemas.add(DefaultNameGenerator.schemaNameForIndex(newIndex));
}
merge.merge();
AkibanInformationSchema newAIS = merge.getAIS();
saveAISChange(session, newAIS, schemas, tableIDs);
}