private PageCursor propertyPage( long reference ) { return read.openPageCursorForReading( reference ); }
@Test void propertyCursorShouldClosePageCursor() { PropertyStore store = mock( PropertyStore.class ); PageCursor pageCursor = mock( PageCursor.class ); when( store.openPageCursorForReading( anyLong() ) ).thenReturn( pageCursor ); try ( RecordPropertyCursor cursor = new RecordPropertyCursor( store ) ) { cursor.init( 0 ); } verify( pageCursor ).close(); } }
private static long calculateNumberOfProperties( NeoStores stores ) { long count = 0; PropertyRecord record = stores.getPropertyStore().newRecord(); try ( PageCursor cursor = stores.getPropertyStore().openPageCursorForReading( 0 ) ) { long highId = stores.getPropertyStore().getHighId(); for ( long id = 0; id < highId; id++ ) { stores.getPropertyStore().getRecordByCursor( id, record, CHECK, cursor ); if ( record.inUse() ) { count += count( record ); } } } return count; }
PropertyRecord propertyRecord = propertyStore.newRecord(); try ( PageCursor cursor = nodeStore.openPageCursorForReading( 0 ); PageCursor propertyCursor = propertyStore.openPageCursorForReading( 0 ) )
private PageCursor propertyPage( long reference ) { return read.openPageCursorForReading( reference ); }
PropertyRecord propertyRecord = propertyStore.newRecord(); try ( PageCursor cursor = nodeStore.openPageCursorForReading( 0 ); PageCursor propertyCursor = propertyStore.openPageCursorForReading( 0 ) )