private static void propagateMap(ILSMIndexOperationContext src, ILSMIndexOperationContext destination) { Map<String, Object> map = src.getParameters(); if (map != null && !map.isEmpty()) { destination.setParameters(new HashMap<>(map)); } }
for (ILSMIndex lsmIndex : dsInfo.getDatasetPartitionOpenIndexes(partition)) { ILSMIndexAccessor accessor = lsmIndex.createAccessor(NoOpIndexAccessParameters.INSTANCE); accessor.getOpContext().setParameters(flushMap); ILSMIOOperation flush = accessor.scheduleFlush(); lastFlushTime = System.nanoTime();
flushMap.put(LSMIOOperationCallback.KEY_FLUSH_LOG_LSN, flushLsn); ILSMIndexAccessor accessor = index.createAccessor(NoOpIndexAccessParameters.INSTANCE); accessor.getOpContext().setParameters(flushMap); long minId = logRecord.getFlushingComponentMinId(); long maxId = logRecord.getFlushingComponentMaxId();
@Override public void run() { ILSMIndexAccessor lsmAccessor = lsmBtree.createAccessor(NoOpIndexAccessParameters.INSTANCE); try { dsLifecycleMgr.getComponentIdGenerator(StorageTestUtils.DATASET_ID, PARTITION, indexPath) .refresh(); ILSMComponentId next = dsLifecycleMgr .getComponentIdGenerator(StorageTestUtils.DATASET_ID, PARTITION, indexPath).getId(); long flushLsn = nc.getTransactionSubsystem().getLogManager().getAppendLSN(); Map<String, Object> flushMap = new HashMap<>(); flushMap.put(LSMIOOperationCallback.KEY_FLUSH_LOG_LSN, flushLsn); flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, next); lsmAccessor.getOpContext().setParameters(flushMap); lsmAccessor.deleteComponents(predicate); } catch (HyracksDataException e) { failure = e; } } };
flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, expectedId); ILSMIndexAccessor accessor = new TestLSMIndexAccessor(new TestLSMIndexOperationContext(mockIndex)); accessor.getOpContext().setParameters(flushMap); FileReference target = new FileReference(Mockito.mock(IODeviceHandle.class), getComponentFileName()); LSMComponentFileReferences files = new LSMComponentFileReferences(target, target, target);
flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, nextComponentId); ILSMIndexAccessor firstAccessor = new TestLSMIndexAccessor(new TestLSMIndexOperationContext(mockIndex)); firstAccessor.getOpContext().setParameters(flushMap); FileReference firstTarget = new FileReference(Mockito.mock(IODeviceHandle.class), getComponentFileName()); LSMComponentFileReferences firstFiles = new LSMComponentFileReferences(firstTarget, firstTarget, firstTarget); flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, nextComponentId); ILSMIndexAccessor secondAccessor = new TestLSMIndexAccessor(new TestLSMIndexOperationContext(mockIndex)); secondAccessor.getOpContext().setParameters(flushMap); FileReference secondTarget = new FileReference(Mockito.mock(IODeviceHandle.class), getComponentFileName()); LSMComponentFileReferences secondFiles =
flushMap.put(LSMIOOperationCallback.KEY_FLUSH_LOG_LSN, flushLsn); flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, next); lsmAccessor.getOpContext().setParameters(flushMap); flushMap.put(LSMIOOperationCallback.KEY_FLUSH_LOG_LSN, flushLsn); flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, next); lsmAccessor.getOpContext().setParameters(flushMap); DiskComponentLsnPredicate pred = new DiskComponentLsnPredicate(lsn); lsmAccessor.deleteComponents(pred);
flushMap.put(LSMIOOperationCallback.KEY_FLUSH_LOG_LSN, flushLsn); flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, next); lsmAccessor.getOpContext().setParameters(flushMap); flushMap.put(LSMIOOperationCallback.KEY_FLUSH_LOG_LSN, flushLsn); flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, next); lsmAccessor.getOpContext().setParameters(flushMap); DiskComponentLsnPredicate pred = new DiskComponentLsnPredicate(lsn); lsmAccessor.deleteComponents(pred);
flushMap.put(LSMIOOperationCallback.KEY_FLUSH_LOG_LSN, flushLsn); flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, next); lsmAccessor.getOpContext().setParameters(flushMap); flushMap.put(LSMIOOperationCallback.KEY_FLUSH_LOG_LSN, flushLsn); flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, next); lsmAccessor.getOpContext().setParameters(flushMap); DiskComponentLsnPredicate pred = new DiskComponentLsnPredicate(lsn); lsmAccessor.deleteComponents(pred);