Search in sources :

Example 1 with InsertPipeline

use of com.torodb.torod.pipeline.InsertPipeline in project torodb by torodb.

the class SqlWriteTorodTransaction method insert.

@Override
public void insert(String db, String collection, Stream<KvDocument> documents) throws RollbackException, UserException {
    Preconditions.checkState(!isClosed());
    MutableMetaDatabase metaDb = getOrCreateMetaDatabase(db);
    MutableMetaCollection metaCol = getOrCreateMetaCollection(metaDb, collection);
    //TODO: here we can not use a pipeline
    InsertPipeline pipeline = getConnection().getServer().getInsertPipelineFactory().createInsertPipeline(getConnection().getServer().getD2RTranslatorFactory(), metaDb, metaCol, getInternalTransaction().getBackendTransaction(), concurrent);
    pipeline.insert(documents);
}
Also used : MutableMetaCollection(com.torodb.core.transaction.metainf.MutableMetaCollection) MutableMetaDatabase(com.torodb.core.transaction.metainf.MutableMetaDatabase) InsertPipeline(com.torodb.torod.pipeline.InsertPipeline)

Aggregations

MutableMetaCollection (com.torodb.core.transaction.metainf.MutableMetaCollection)1 MutableMetaDatabase (com.torodb.core.transaction.metainf.MutableMetaDatabase)1 InsertPipeline (com.torodb.torod.pipeline.InsertPipeline)1