@Override public void updateFilter(ILSMIndexOperationContext ctx, ITupleReference tuple) throws HyracksDataException { if (!lsmIndex.isMemoryComponentsAllocated()) { lsmIndex.allocateMemoryComponents(); } lsmIndex.updateFilter(ctx, tuple); }
private void enter(ILSMIndexOperationContext ctx) throws HyracksDataException { if (!lsmIndex.isMemoryComponentsAllocated()) { lsmIndex.allocateMemoryComponents(); } getAndEnterComponents(ctx, LSMOperationType.MODIFICATION, false); }
@Override public ILSMIOOperation scheduleFlush(ILSMIndexOperationContext ctx) throws HyracksDataException { ILSMIOOperation flush; LOGGER.debug("Flush is being scheduled on {}", lsmIndex); if (!lsmIndex.isMemoryComponentsAllocated()) { lsmIndex.allocateMemoryComponents(); } synchronized (opTracker) { try { flush = lsmIndex.createFlushOperation(ctx); } finally { // Notify all waiting threads whenever a flush has been scheduled since they will check // again if they can grab and enter the mutable component. opTracker.notifyAll(); } } ioScheduler.scheduleOperation(flush); return flush; }
@Override public void updateMeta(ILSMIndexOperationContext ctx, IValueReference key, IValueReference value) throws HyracksDataException { if (!lsmIndex.isMemoryComponentsAllocated()) { lsmIndex.allocateMemoryComponents(); } getAndEnterComponents(ctx, LSMOperationType.MODIFICATION, false); try { AbstractLSMMemoryComponent c = (AbstractLSMMemoryComponent) ctx.getComponentHolder().get(0); c.getMetadata().put(key, value); c.setModified(); } finally { exitAndComplete(ctx, LSMOperationType.MODIFICATION); } }
@Override public void forceUpdateMeta(ILSMIndexOperationContext ctx, IValueReference key, IValueReference value) throws HyracksDataException { if (!lsmIndex.isMemoryComponentsAllocated()) { lsmIndex.allocateMemoryComponents(); } getAndEnterComponents(ctx, LSMOperationType.FORCE_MODIFICATION, false); try { AbstractLSMMemoryComponent c = (AbstractLSMMemoryComponent) ctx.getComponentHolder().get(0); c.getMetadata().put(key, value); c.setModified(); } finally { exitAndComplete(ctx, LSMOperationType.FORCE_MODIFICATION); } }
private boolean modify(ILSMIndexOperationContext ctx, boolean tryOperation, ITupleReference tuple, LSMOperationType opType) throws HyracksDataException { if (!lsmIndex.isMemoryComponentsAllocated()) { lsmIndex.allocateMemoryComponents(); } boolean failedOperation = false; if (!getAndEnterComponents(ctx, opType, tryOperation)) { return false; } try { lsmIndex.modify(ctx, tuple); // The mutable component is always in the first index. AbstractLSMMemoryComponent mutableComponent = (AbstractLSMMemoryComponent) ctx.getComponentHolder().get(0); mutableComponent.setModified(); } catch (Exception e) { failedOperation = true; throw e; } finally { exitComponents(ctx, opType, null, failedOperation); } return true; }
if (!lsmIndex.isMemoryComponentsAllocated()) { lsmIndex.allocateMemoryComponents();
checkMemoryComponent(id, mockComponent); Mockito.when(mockIndex.isMemoryComponentsAllocated()).thenReturn(true); for (int i = 0; i < 100; i++) {