private void nodeAdvance( NodeRecord record, PageCursor pageCursor ) { read.nextRecordByCursor( record, RecordLoad.CHECK, pageCursor ); } }
@Test public void shouldBeAbleToForceStoreScan() throws Exception { when( labelScanStore.newReader() ).thenThrow( new RuntimeException( "Should not be used" ) ); when( nodeStore.getHighestPossibleIdInUse() ).thenReturn( 200L ); when( nodeStore.getHighId() ).thenReturn( 20L ); when( nodeStore.openPageCursorForReading( anyLong() ) ).thenReturn( mock( PageCursor.class ) ); mockLabelNodeCount( countStore, 2 ); mockLabelNodeCount( countStore, 6 ); DynamicIndexStoreView storeView = dynamicIndexStoreView(); StoreScan<Exception> storeScan = storeView .visitNodes( new int[]{2, 6}, propertyKeyIdFilter, propertyUpdateVisitor, labelUpdateVisitor, true ); storeScan.run(); Mockito.verify( nodeStore, times( 1 ) ) .getRecordByCursor( anyLong(), any( NodeRecord.class ), any( RecordLoad.class ), any( PageCursor.class ) ); Mockito.verify( nodeStore, times( 200 ) ) .nextRecordByCursor( any( NodeRecord.class ), any( RecordLoad.class ), any( PageCursor.class ) ); }
@Before public void setUp() { NodeRecord nodeRecord = getNodeRecord(); when( labelScanStore.allNodeLabelRanges()).thenReturn( nodeLabelRanges ); when( neoStores.getCounts() ).thenReturn( countStore ); when( neoStores.getNodeStore() ).thenReturn( nodeStore ); when( nodeStore.newRecord() ).thenReturn( nodeRecord ); doAnswer( invocation -> { NodeRecord record = invocation.getArgument( 1 ); record.initialize( true, 1L, false, 1L, 0L ); record.setId( invocation.getArgument( 0 ) ); return null; } ).when( nodeStore ).getRecordByCursor( anyLong(), any( NodeRecord.class ), any( RecordLoad.class ), any( PageCursor.class ) ); doAnswer( invocation -> { NodeRecord record = invocation.getArgument( 0 ); record.initialize( true, 1L, false, 1L, 0L ); record.setId( record.getId() + 1 ); return null; } ).when( nodeStore ).nextRecordByCursor( any( NodeRecord.class ), any( RecordLoad.class ), any( PageCursor.class ) ); }
private void nodeAdvance( NodeRecord record, PageCursor pageCursor ) { read.nextRecordByCursor( record, RecordLoad.CHECK, pageCursor ); } }