use of com.torodb.mongodb.commands.signatures.admin.CreateIndexesCommand in project torodb by torodb.
the class OplogOperationApplier method insertIndex.
private void insertIndex(BsonDocument indexDoc, String database, ExclusiveWriteMongodTransaction trans) throws OplogApplyingException {
try {
CreateIndexesCommand command = CreateIndexesCommand.INSTANCE;
IndexOptions indexOptions = IndexOptions.unmarshall(indexDoc);
CreateIndexesArgument arg = new CreateIndexesArgument(indexOptions.getCollection(), Arrays.asList(new IndexOptions[] { indexOptions }));
Status executionResult = executeReplCommand(database, command, arg, trans.getTorodTransaction());
if (!executionResult.isOk()) {
throw new OplogApplyingException(new MongoException(executionResult));
}
} catch (MongoException ex) {
throw new OplogApplyingException(ex);
}
}
Aggregations