@Override public void search(ILSMIndexOperationContext ictx, IIndexCursor cursor, ISearchPredicate pred) throws HyracksDataException { LSMRTreeOpContext ctx = (LSMRTreeOpContext) ictx; cursor.open(ctx.getSearchInitialState(), pred); }
@Override public Object answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); IIndexCursor cursor = (IIndexCursor) args[0]; ISearchPredicate pred = (ISearchPredicate) args[1]; cursor.open(null, pred); return null; } }).when(accessor).search(Matchers.any(IIndexCursor.class), Matchers.any(ISearchPredicate.class));
@Override public void search(ILSMIndexOperationContext ictx, IIndexCursor cursor, ISearchPredicate pred) throws HyracksDataException { ExternalRTreeOpContext ctx = (ExternalRTreeOpContext) ictx; List<ILSMComponent> operationalComponents = ictx.getComponentHolder(); ctx.getInitialState().setOperationalComponents(operationalComponents); cursor.open(ctx.getInitialState(), pred); }
@Override public void search(ILSMIndexOperationContext ictx, IIndexCursor cursor, ISearchPredicate pred) throws HyracksDataException { LSMBTreeOpContext ctx = (LSMBTreeOpContext) ictx; List<ILSMComponent> operationalComponents = ctx.getComponentHolder(); ctx.getSearchInitialState().reset(pred, operationalComponents); cursor.open(ctx.getSearchInitialState(), pred); }
@Override public void search(ILSMIndexOperationContext ictx, IIndexCursor cursor, ISearchPredicate pred) throws HyracksDataException { ExternalBTreeOpContext ctx = (ExternalBTreeOpContext) ictx; List<ILSMComponent> operationalComponents = ctx.getComponentHolder(); ctx.getSearchInitialState().reset(pred, operationalComponents); cursor.open(ctx.getSearchInitialState(), pred); }
@Override public void search(ILSMIndexOperationContext ictx, IIndexCursor cursor, ISearchPredicate pred) throws HyracksDataException { ExternalBTreeWithBuddyOpContext ctx = (ExternalBTreeWithBuddyOpContext) ictx; List<ILSMComponent> operationalComponents = ictx.getComponentHolder(); ctx.getSearchInitialState().setOperationalComponents(operationalComponents); cursor.open(ctx.getSearchInitialState(), pred); }
@Override public void search(ILSMIndexOperationContext ictx, IIndexCursor cursor, ISearchPredicate pred) throws HyracksDataException { LSMInvertedIndexOpContext ctx = (LSMInvertedIndexOpContext) ictx; List<ILSMComponent> operationalComponents = ictx.getComponentHolder(); int numComponents = operationalComponents.size(); boolean includeMutableComponent = false; ArrayList<IIndexAccessor> indexAccessors = new ArrayList<>(numComponents); ArrayList<IIndexAccessor> deletedKeysBTreeAccessors = new ArrayList<>(numComponents); for (int i = 0; i < operationalComponents.size(); i++) { ILSMComponent component = operationalComponents.get(i); if (component.getType() == LSMComponentType.MEMORY) { includeMutableComponent = true; IIndexAccessor invIndexAccessor = component.getIndex().createAccessor(ctx.getIndexAccessParameters()); indexAccessors.add(invIndexAccessor); IIndexAccessor deletedKeysAccessor = ((LSMInvertedIndexMemoryComponent) component).getBuddyIndex() .createAccessor(NoOpIndexAccessParameters.INSTANCE); deletedKeysBTreeAccessors.add(deletedKeysAccessor); } else { IIndexAccessor invIndexAccessor = component.getIndex().createAccessor(ctx.getIndexAccessParameters()); indexAccessors.add(invIndexAccessor); IIndexAccessor deletedKeysAccessor = ((LSMInvertedIndexDiskComponent) component).getBuddyIndex() .createAccessor(NoOpIndexAccessParameters.INSTANCE); deletedKeysBTreeAccessors.add(deletedKeysAccessor); } } ICursorInitialState initState = createCursorInitialState(pred, ictx, includeMutableComponent, indexAccessors, deletedKeysBTreeAccessors, operationalComponents); cursor.open(initState, pred); }
resultCursor.open(null, searchPred);
@Override protected void open(IIndexAccessor accessor, IIndexCursor cursor, ISearchPredicate predicate) throws HyracksDataException { opCtx.reset(); opCtx.setOperation(IndexOperation.SEARCH); lsmBtree.getOperationalComponents(opCtx); opCtx.getSearchInitialState().reset(predicate, opCtx.getComponentHolder()); cursor.open(opCtx.getSearchInitialState(), predicate); }
@Override protected void open(IIndexAccessor accessor, IIndexCursor cursor, ISearchPredicate predicate) throws HyracksDataException { opCtx.reset(); opCtx.setOperation(IndexOperation.SEARCH); lsmBtree.getOperationalComponents(opCtx); opCtx.getSearchInitialState().reset(predicate, opCtx.getComponentHolder()); cursor.open(opCtx.getSearchInitialState(), predicate); }