@Override public ILSMIOOperation scheduleFullMerge() throws HyracksDataException { ctx.setOperation(IndexOperation.FULL_MERGE); return lsmHarness.scheduleFullMerge(ctx); }
@Override public ILSMIOOperation scheduleFullMerge() throws HyracksDataException { ctx.setOperation(IndexOperation.FULL_MERGE); return lsmHarness.scheduleFullMerge(ctx); }
@Override public void forceUpsert(ITupleReference tuple) throws HyracksDataException { ctx.setOperation(IndexOperation.UPSERT); lsmHarness.forceModify(ctx, tuple); }
@Override public void updateMeta(IValueReference key, IValueReference value) throws HyracksDataException { ctx.setOperation(IndexOperation.UPSERT); lsmHarness.updateMeta(ctx, key, value); }
@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 void upsert(ITupleReference tuple) throws HyracksDataException { ctx.setOperation(IndexOperation.UPSERT); lsmHarness.modify(ctx, false, tuple); }
@Override public void physicalDelete(ITupleReference tuple) throws HyracksDataException { ctx.setOperation(IndexOperation.PHYSICALDELETE); lsmHarness.modify(ctx, false, tuple); }
@Override public void scanDiskComponents(IIndexCursor cursor) throws HyracksDataException { ctx.setOperation(IndexOperation.DISK_COMPONENT_SCAN); lsmHarness.scanDiskComponents(ctx, cursor); }
@Override public boolean tryInsert(ITupleReference tuple) throws HyracksDataException { ctx.setOperation(IndexOperation.INSERT); return lsmHarness.modify(ctx, true, tuple); }
@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 void delete(ITupleReference tuple) throws HyracksDataException { ctx.setOperation(IndexOperation.DELETE); lsmHarness.modify(ctx, false, tuple); }
@Override public void search(IIndexCursor cursor, ISearchPredicate searchPred) throws HyracksDataException { ctx.setOperation(IndexOperation.SEARCH); lsmHarness.search(ctx, cursor, searchPred); }
@Override public ILSMIOOperation scheduleFlush() throws HyracksDataException { ctx.setOperation(IndexOperation.FLUSH); return lsmHarness.scheduleFlush(ctx); }
@Override public void forcePhysicalDelete(ITupleReference tuple) throws HyracksDataException { ctx.setOperation(IndexOperation.PHYSICALDELETE); lsmHarness.forceModify(ctx, tuple); }
@Override public void forceUpdateMeta(IValueReference key, IValueReference value) throws HyracksDataException { ctx.setOperation(IndexOperation.UPSERT); lsmHarness.forceUpdateMeta(ctx, key, value); }
@Override public void updateFilter(ITupleReference tuple) throws HyracksDataException { ctx.setOperation(IndexOperation.UPSERT); lsmHarness.updateFilter(ctx, tuple); }
@Override public void scheduleReplication(List<ILSMDiskComponent> lsmComponents, LSMOperationType opType) throws HyracksDataException { ctx.setOperation(IndexOperation.REPLICATE); ctx.getComponentsToBeReplicated().clear(); ctx.getComponentsToBeReplicated().addAll(lsmComponents); lsmHarness.scheduleReplication(ctx, lsmComponents, opType); }
@Override public ILSMIOOperation scheduleMerge(List<ILSMDiskComponent> components) throws HyracksDataException { ctx.setOperation(IndexOperation.MERGE); ctx.getComponentsToBeMerged().clear(); ctx.getComponentsToBeMerged().addAll(components); return lsmHarness.scheduleMerge(ctx); }
@Override public void scheduleReplication(List<ILSMDiskComponent> lsmComponents, LSMOperationType opType) throws HyracksDataException { ctx.setOperation(IndexOperation.REPLICATE); ctx.getComponentsToBeReplicated().clear(); ctx.getComponentsToBeReplicated().addAll(lsmComponents); lsmHarness.scheduleReplication(ctx, lsmComponents, opType); }
private void assertCorrectSearchComponents(ILSMIndexOperationContext opCtx, ILSMIndex index, int numSuccesfullyCompletedFlushes) throws HyracksDataException { opCtx.reset(); opCtx.setOperation(IndexOperation.SEARCH); index.getOperationalComponents(opCtx); List<ILSMMemoryComponent> memComponents = index.getMemoryComponents(); int first = numSuccesfullyCompletedFlushes % memComponents.size(); Assert.assertEquals(memComponents.get(first), getFirstMemoryComponent(opCtx)); }