@Override public void endSearch(ILSMIndexOperationContext ctx) throws HyracksDataException { if (ctx.getOperation() == IndexOperation.SEARCH) { try { exitComponents(ctx, LSMOperationType.SEARCH, null, false); } catch (Exception e) { throw HyracksDataException.create(e); } } }
@Override public void endSearch(ILSMIndexOperationContext ctx) throws HyracksDataException { if (ctx.getOperation() == IndexOperation.SEARCH) { try { exitComponents(ctx, LSMOperationType.SEARCH, null, false); } catch (Exception e) { throw HyracksDataException.create(e); } } }
@Override public void endScanDiskComponents(ILSMIndexOperationContext ctx) throws HyracksDataException { if (ctx.getOperation() == IndexOperation.DISK_COMPONENT_SCAN) { try { exitComponents(ctx, LSMOperationType.DISK_COMPONENT_SCAN, null, false); } catch (Exception e) { throw HyracksDataException.create(e); } } }
switch (ctx.getOperation()) { case SEARCH: if (opCtx.getTargetIndexVersion() == 0) { break; default: throw new UnsupportedOperationException("Operation " + ctx.getOperation() + " not supported.");
switch (ctx.getOperation()) { case SEARCH: if (opCtx.getTargetIndexVersion() == 0) { throw new UnsupportedOperationException("Operation " + ctx.getOperation() + " not supported.");
switch (ctx.getOperation()) { case SEARCH: if (opCtx.getTargetIndexVersion() == 0) { throw new UnsupportedOperationException("Operation " + ctx.getOperation() + " not supported.");
@Override public final ILSMDiskComponent merge(ILSMIOOperation operation) throws HyracksDataException { ILSMIndexAccessor accessor = operation.getAccessor(); ILSMIndexOperationContext opCtx = accessor.getOpContext(); return opCtx.getOperation() == IndexOperation.DELETE_COMPONENTS ? EmptyComponent.INSTANCE : doMerge(operation); }
|| (mergingComponents.size() < 2 && ctx.getOperation() != IndexOperation.DELETE_COMPONENTS)) { return NoOpIoOperation.INSTANCE; mergeCtx.setOperation(ctx.getOperation()); mergeCtx.getComponentHolder().addAll(mergingComponents); propagateMap(ctx, mergeCtx);
ctx.setCurrentMutableComponentId(cmc); operationalComponents.clear(); switch (ctx.getOperation()) { case UPDATE: case PHYSICALDELETE: break; default: throw new UnsupportedOperationException("Operation " + ctx.getOperation() + " not supported.");
@Override public final ILSMDiskComponent flush(ILSMIOOperation operation) throws HyracksDataException { ILSMIndexAccessor accessor = operation.getAccessor(); ILSMIndexOperationContext opCtx = accessor.getOpContext(); ILSMMemoryComponent memoryComponent = (ILSMMemoryComponent) opCtx.getComponentHolder().get(0); if (memoryComponent != getOldestReadableMemoryComponent()) { throw new IllegalStateException("An attempt to flush a memory component that is not the oldest"); } if (!memoryComponent.isModified() || opCtx.getOperation() == IndexOperation.DELETE_COMPONENTS) { return EmptyComponent.INSTANCE; } if (LOGGER.isInfoEnabled()) { FlushOperation flushOp = (FlushOperation) operation; LOGGER.log(Level.INFO, "Flushing component with id: " + flushOp.getFlushingComponent().getId() + " in the index " + this); } return doFlush(operation); }
@Override public void afterFinalize(ILSMIOOperation operation) throws HyracksDataException { if (operation.getStatus() == LSMIOOperationStatus.FAILURE) { return; } if (operation.getIOOpertionType() != LSMIOOperationType.LOAD && operation.getAccessor().getOpContext().getOperation() == IndexOperation.DELETE_COMPONENTS) { deleteComponentsFromCheckpoint(operation); } else if (operation.getIOOpertionType() == LSMIOOperationType.FLUSH || operation.getIOOpertionType() == LSMIOOperationType.LOAD) { addComponentToCheckpoint(operation); } }
@Override public ILSMIOOperation createFlushOperation(ILSMIndexOperationContext ctx) throws HyracksDataException { ILSMMemoryComponent flushingComponent = getCurrentMemoryComponent(); if (flushingComponent.getWriterCount() > 0) { throw new IllegalStateException( "createFlushOperation is called on a component with writers: " + flushingComponent); } // take care of the flush cycling ILSMIOOperation flushOp = TracedIOOperation.wrap(createFlushOperation(createOpContext(NoOpIndexAccessParameters.INSTANCE), fileManager.getRelFlushFileReference(), ioOpCallback), tracer); // Changing the flush status should *always* precede changing the mutable component. flushingComponent.schedule(LSMIOOperationType.FLUSH); numScheduledFlushes++; changeFlushStatusForCurrentMutableCompoent(false); changeMutableComponent(); ILSMIndexAccessor accessor = flushOp.getAccessor(); ILSMIndexOperationContext flushCtx = accessor.getOpContext(); flushCtx.setOperation(ctx.getOperation()); // Could be component delete flushCtx.getComponentHolder().add(flushingComponent); flushCtx.setIoOperation(flushOp); propagateMap(ctx, flushCtx); ioOpCallback.scheduled(flushOp); return flushOp; }