@Override public void recycled(ILSMMemoryComponent component) throws HyracksDataException { component.resetId(componentIds.poll(), false); }
@Override public void resetCurrentComponentIndex() { synchronized (lsmHarness.getOperationTracker()) { // validate no reader in any of the memory components and that all of them are INVALID for (ILSMMemoryComponent c : memoryComponents) { if (c.getReaderCount() > 0) { throw new IllegalStateException( "Attempt to reset current component index while readers are inside the components. " + c); } if (c.getState() != ComponentState.INACTIVE) { throw new IllegalStateException( "Attempt to reset current component index while a component is not INACTIVE. " + c); } } currentMutableComponentId.set(0); memoryComponents.get(0); try { memoryComponents.get(0).resetId(null, true); } catch (HyracksDataException e) { throw new IllegalStateException(e); } } }
private void checkMemoryComponent(ILSMComponentId expected, ILSMMemoryComponent memoryComponent) throws HyracksDataException { ArgumentCaptor<ILSMComponentId> idArgument = ArgumentCaptor.forClass(ILSMComponentId.class); ArgumentCaptor<Boolean> forceArgument = ArgumentCaptor.forClass(Boolean.class); Mockito.verify(memoryComponent).resetId(idArgument.capture(), forceArgument.capture()); assertEquals(expected, idArgument.getValue()); assertEquals(false, forceArgument.getValue().booleanValue()); Mockito.reset(memoryComponent); }
index.getCurrentMemoryComponent().resetId(id, true); ILSMIOOperation flush = accessor.scheduleFlush(); try {