@Override public void doClose() throws HyracksDataException { try { closeCursors(); nextHasBeenCalled = false; foundTuple = false; } finally { if (lsmHarness != null) { lsmHarness.endSearch(opCtx); } } }
@Override public void forcePhysicalDelete(ITupleReference tuple) throws HyracksDataException { ctx.setOperation(IndexOperation.PHYSICALDELETE); lsmHarness.forceModify(ctx, tuple); }
@Override public void update(ITupleReference tuple) throws HyracksDataException { // Update is the same as insert. ctx.setOperation(IndexOperation.UPDATE); lsmHarness.modify(ctx, false, tuple); }
@Override public ILSMIOOperation scheduleFlush() throws HyracksDataException { ctx.setOperation(IndexOperation.FLUSH); return lsmHarness.scheduleFlush(ctx); }
@Override public void forceUpdateMeta(IValueReference key, IValueReference value) throws HyracksDataException { // a hack because delete only gets the memory component ctx.setOperation(IndexOperation.DELETE); lsmHarness.forceUpdateMeta(ctx, key, value); }
@Override public ILSMIOOperation scheduleFullMerge() throws HyracksDataException { ctx.setOperation(IndexOperation.FULL_MERGE); return lsmHarness.scheduleFullMerge(ctx); }
@Override public void deleteComponents(Predicate<ILSMComponent> predicate) throws HyracksDataException { lsmHarness.deleteComponents(ctx, predicate); }
@Override public void merge(ILSMIOOperation operation) throws HyracksDataException { lsmHarness.merge(operation); }
@Override public void flush(ILSMIOOperation operation) throws HyracksDataException { lsmHarness.flush(operation); }
@Override public void end() throws HyracksDataException { try { ioOpCallback.afterOperation(loadOp); componentBulkLoader.end(); if (component.getComponentSize() > 0) { if (isTransaction) { // Since this is a transaction component, validate and // deactivate. it could later be added or deleted try { component.markAsValid(durable, loadOp); } finally { ioOpCallback.afterFinalize(loadOp); } component.deactivate(); } else { ioOpCallback.afterFinalize(loadOp); getHarness().addBulkLoadedComponent(loadOp); } } } finally { ioOpCallback.completed(loadOp); } }
@Override public ILSMIOOperation scheduleFlush() throws HyracksDataException { ctx.setOperation(IndexOperation.FLUSH); return lsmHarness.scheduleFlush(ctx); }
@Override public void forceUpdateMeta(IValueReference key, IValueReference value) throws HyracksDataException { ctx.setOperation(IndexOperation.UPSERT); lsmHarness.forceUpdateMeta(ctx, key, value); }
@Override public ILSMIOOperation scheduleFullMerge() throws HyracksDataException { ctx.setOperation(IndexOperation.FULL_MERGE); return lsmHarness.scheduleFullMerge(ctx); }
@Override public void deleteComponents(Predicate<ILSMComponent> predicate) throws HyracksDataException { lsmHarness.deleteComponents(ctx, predicate); }
@Override public void merge(ILSMIOOperation operation) throws HyracksDataException { lsmHarness.merge(operation); }
@Override public void flush(ILSMIOOperation operation) throws HyracksDataException { lsmHarness.flush(operation); }
private void presistComponentToDisk() throws HyracksDataException { try { lsmIndex.getIOOperationCallback().afterOperation(opCtx.getIoOperation()); componentBulkLoader.end(); } catch (Throwable th) { // NOSONAR Must not call afterFinalize without setting failure fail(th); throw th; } finally { lsmIndex.getIOOperationCallback().afterFinalize(opCtx.getIoOperation()); } if (opCtx.getIoOperation().getStatus() == LSMIOOperationStatus.SUCCESS && opCtx.getIoOperation().getNewComponent().getComponentSize() > 0) { lsmIndex.getHarness().addBulkLoadedComponent(opCtx.getIoOperation()); } }
@Override public void doClose() throws HyracksDataException { try { if (currentCursor != null) { currentCursor.close(); currentCursor = null; } accessorIndex = 0; } finally { if (harness != null) { harness.endSearch(opCtx); } } }
@Override public void upsert(ITupleReference tuple) throws HyracksDataException { ctx.setOperation(IndexOperation.UPSERT); lsmHarness.modify(ctx, false, tuple); }
@Override public void forceUpsert(ITupleReference tuple) throws HyracksDataException { ctx.setOperation(IndexOperation.UPSERT); lsmHarness.forceModify(ctx, tuple); }