private long getRecordValue( PageCursor cursor, Position position, long defaultValue ) { MetaDataRecord record = newRecord(); try { record.setId( position.id ); recordFormat.read( record, cursor, FORCE, RECORD_SIZE ); if ( record.inUse() ) { return record.getValue(); } return defaultValue; } catch ( IOException e ) { throw new UnderlyingStorageException( e ); } }
try ( MetaDataStore store = newMetaDataStore() ) MetaDataRecord record = store.newRecord(); try ( PageCursor cursor = store.openPageCursorForReading( 0 ) )
private long getRecordValue( PageCursor cursor, Position position, long defaultValue ) { MetaDataRecord record = newRecord(); try { record.setId( position.id ); recordFormat.read( record, cursor, FORCE, RECORD_SIZE ); if ( record.inUse() ) { return record.getValue(); } return defaultValue; } catch ( IOException e ) { throw new UnderlyingStorageException( e ); } }