private boolean nextValidTuple() throws HyracksDataException { while (currentCursor.hasNext()) { currentCursor.next(); currentTuple = currentCursor.getTuple(); resultOfSearchCallBackProceed = includeMemoryComponents && accessorIndex == 0 ? searchCallback.proceed(currentTuple) : true; if (!resultOfSearchCallBackProceed) { // We assume that the underlying cursors materialize their results such that // there is no need to reposition the result cursor after reconciliation. searchCallback.reconcile(currentTuple); } if (!isDeleted(currentTuple)) { tupleConsumed = false; return true; } else if (!resultOfSearchCallBackProceed) { // reconcile & tuple deleted case: needs to cancel the effect of reconcile(). searchCallback.cancel(currentTuple); } } return false; }
@Override public void search(ILSMIndexOperationContext ctx, IIndexCursor cursor, ISearchPredicate pred) throws HyracksDataException { LSMOperationType opType = LSMOperationType.SEARCH; ctx.setSearchPredicate(pred); getAndEnterComponents(ctx, opType, false); try { ctx.getSearchOperationCallback().before(pred.getLowKey()); lsmIndex.search(ctx, cursor, pred); } catch (Exception e) { exitComponents(ctx, opType, null, true); throw e; } }
resultOfSearchCallbackProceed = searchCallback.proceed(predicate.getLowKey()); searchCallback.cancel(predicate.getLowKey()); searchCallback.reconcile(predicate.getLowKey()); reconciled = true; btreeCursors[i].next(); if (((ILSMTreeTupleReference) btreeCursors[i].getTuple()).isAntimatter()) { searchCallback.cancel(predicate.getLowKey()); btreeCursors[i].close(); return false; frameTuple = btreeCursors[i].getTuple(); foundTuple = true; searchCallback.complete(predicate.getLowKey()); foundIn = i; return true; searchCallback.cancel(predicate.getLowKey()); btreeCursors[i].close(); searchCallback.reconcile(frameTuple); searchCallback.complete(frameTuple); foundTuple = true; foundIn = i;
currentCursor == 0 && includeMutableComponent ? searchCallback.proceed(currentTuple) : true; btreeTuple.reset(rtreeCursors[currentCursor].getTuple()); boolean killerTupleFound = false;
@Override public void scanDiskComponents(ILSMIndexOperationContext ctx, IIndexCursor cursor) throws HyracksDataException { if (!lsmIndex.isPrimaryIndex()) { throw HyracksDataException.create(ErrorCode.DISK_COMPONENT_SCAN_NOT_ALLOWED_FOR_SECONDARY_INDEX); } LSMOperationType opType = LSMOperationType.DISK_COMPONENT_SCAN; getAndEnterComponents(ctx, opType, false); try { ctx.getSearchOperationCallback().before(null); lsmIndex.scanDiskComponents(ctx, cursor); } catch (Exception e) { exitComponents(ctx, opType, null, true); throw e; } }