Search in sources :

Example 1 with ITwoPCIndexBulkLoader

use of org.apache.hyracks.storage.am.common.api.ITwoPCIndexBulkLoader in project asterixdb by apache.

the class ExternalIndexBulkModifyOperatorNodePushable method open.

// We override this method to do two things
// when creating the bulkLoader, it creates a transaction bulk loader
// It uses the bulkLoader to insert delete tuples for the deleted files
@Override
public void open() throws HyracksDataException {
    accessor = new FrameTupleAccessor(recDesc);
    indexHelper.open();
    index = indexHelper.getIndexInstance();
    try {
        writer.open();
        // Transactional BulkLoader
        bulkLoader = ((ITwoPCIndex) index).createTransactionBulkLoader(fillFactor, verifyInput, deletedFiles.length);
        // Delete files
        for (int i = 0; i < deletedFiles.length; i++) {
            fileNumber.setValue(deletedFiles[i]);
            FilesIndexDescription.getBuddyBTreeTupleFromFileNumber(deleteTuple, buddyBTreeTupleBuilder, fileNumber);
            ((ITwoPCIndexBulkLoader) bulkLoader).delete(deleteTuple);
        }
    } catch (Throwable e) {
        throw new HyracksDataException(e);
    }
}
Also used : ITwoPCIndexBulkLoader(org.apache.hyracks.storage.am.common.api.ITwoPCIndexBulkLoader) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException) FrameTupleAccessor(org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor)

Aggregations

HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)1 FrameTupleAccessor (org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor)1 ITwoPCIndexBulkLoader (org.apache.hyracks.storage.am.common.api.ITwoPCIndexBulkLoader)1