Search in sources :

Example 1 with ILSMIOOperation

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

the class AbstractLSMIndex method scheduleFlush.

@Override
public void scheduleFlush(ILSMIndexOperationContext ctx, ILSMIOOperationCallback callback) throws HyracksDataException {
    ILSMMemoryComponent flushingComponent = (ILSMMemoryComponent) ctx.getComponentHolder().get(0);
    LSMComponentFileReferences componentFileRefs = fileManager.getRelFlushFileReference();
    AbstractLSMIndexOperationContext opCtx = createOpContext(NoOpOperationCallback.INSTANCE, NoOpOperationCallback.INSTANCE);
    opCtx.setOperation(IndexOperation.FLUSH);
    opCtx.getComponentHolder().add(flushingComponent);
    ILSMIOOperation flushOp = createFlushOperation(opCtx, flushingComponent, componentFileRefs, callback);
    ioScheduler.scheduleOperation(flushOp);
}
Also used : ILSMIOOperation(org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperation) ILSMMemoryComponent(org.apache.hyracks.storage.am.lsm.common.api.ILSMMemoryComponent)

Example 2 with ILSMIOOperation

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

the class AbstractLSMIndex method scheduleMerge.

@Override
public void scheduleMerge(ILSMIndexOperationContext ctx, ILSMIOOperationCallback callback) throws HyracksDataException {
    // merge must create a different op ctx
    AbstractLSMIndexOperationContext opCtx = createOpContext(NoOpOperationCallback.INSTANCE, NoOpOperationCallback.INSTANCE);
    opCtx.setOperation(IndexOperation.MERGE);
    List<ILSMComponent> mergingComponents = ctx.getComponentHolder();
    ILSMDiskComponent firstComponent = (ILSMDiskComponent) mergingComponents.get(0);
    ILSMDiskComponent lastComponent = (ILSMDiskComponent) mergingComponents.get(mergingComponents.size() - 1);
    LSMComponentFileReferences mergeFileRefs = getMergeFileReferences(firstComponent, lastComponent);
    ILSMIOOperation mergeOp = createMergeOperation(opCtx, mergingComponents, mergeFileRefs, callback);
    ioScheduler.scheduleOperation(mergeOp);
}
Also used : ILSMDiskComponent(org.apache.hyracks.storage.am.lsm.common.api.ILSMDiskComponent) ILSMIOOperation(org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperation) ILSMComponent(org.apache.hyracks.storage.am.lsm.common.api.ILSMComponent)

Aggregations

ILSMIOOperation (org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperation)2 ILSMComponent (org.apache.hyracks.storage.am.lsm.common.api.ILSMComponent)1 ILSMDiskComponent (org.apache.hyracks.storage.am.lsm.common.api.ILSMDiskComponent)1 ILSMMemoryComponent (org.apache.hyracks.storage.am.lsm.common.api.ILSMMemoryComponent)1