private void exitAndComplete(ILSMIndexOperationContext ctx, LSMOperationType op) throws HyracksDataException { try { exitComponents(ctx, op, null, false); } finally { opTracker.completeOperation(null, op, null, ctx.getModificationCallback()); } }
@Override public void updateFilter(ILSMIndexOperationContext ctx, ITupleReference tuple) throws HyracksDataException { if (ctx.getFilterTuple() != null && !ctx.isFilterSkipped()) { if (ctx.isRecovery()) { memoryComponents.get(currentMutableComponentId.get()).getLSMComponentFilter().update(tuple, ctx.getFilterCmp(), ctx.getModificationCallback()); } else { ctx.getFilterTuple().reset(tuple); memoryComponents.get(currentMutableComponentId.get()).getLSMComponentFilter() .update(ctx.getFilterTuple(), ctx.getFilterCmp(), ctx.getModificationCallback()); } } }
opTracker.beforeOperation(lsmIndex, opType, ctx.getSearchOperationCallback(), ctx.getModificationCallback()); return true;
@SuppressWarnings("squid:S2142") @Override public void flush(ILSMIOOperation operation) throws HyracksDataException { LOGGER.debug("Started a flush operation for index: {}", lsmIndex); synchronized (opTracker) { while (!enterComponents(operation.getAccessor().getOpContext(), LSMOperationType.FLUSH)) { try { opTracker.wait(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw HyracksDataException.create(e); } } } try { doIo(operation); } finally { exitComponents(operation.getAccessor().getOpContext(), LSMOperationType.FLUSH, operation.getNewComponent(), operation.getStatus() == LSMIOOperationStatus.FAILURE); opTracker.completeOperation(lsmIndex, LSMOperationType.FLUSH, operation.getAccessor().getOpContext().getSearchOperationCallback(), operation.getAccessor().getOpContext().getModificationCallback()); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Finished the flush operation for index: {}. Result: {}", lsmIndex, operation.getStatus()); } }
@Override public void merge(ILSMIOOperation operation) throws HyracksDataException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Started a merge operation for index: {}", lsmIndex); } synchronized (opTracker) { enterComponents(operation.getAccessor().getOpContext(), LSMOperationType.MERGE); } try { doIo(operation); } finally { exitComponents(operation.getAccessor().getOpContext(), LSMOperationType.MERGE, operation.getNewComponent(), operation.getStatus() == LSMIOOperationStatus.FAILURE); opTracker.completeOperation(lsmIndex, LSMOperationType.MERGE, operation.getAccessor().getOpContext().getSearchOperationCallback(), operation.getAccessor().getOpContext().getModificationCallback()); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Finished the merge operation for index: {}. Result: {}", lsmIndex, operation.getStatus()); } }
opTracker.beforeOperation(lsmIndex, opType, ctx.getSearchOperationCallback(), ctx.getModificationCallback()); return true;
ctx.getModificationCallback()); } else { opTracker.afterOperation(lsmIndex, opType, ctx.getSearchOperationCallback(), ctx.getModificationCallback());