@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; } }
@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; } }