private static <RECORD extends AbstractBaseRecord> RECORD inUse( RECORD record ) { record.setInUse( true ); return record; }
private void prepareForReading( PageCursor cursor, RECORD record ) { // Mark this record as unused. This to simplify implementations of readRecord. // readRecord can behave differently depending on RecordLoad argument and so it may be that // contents of a record may be loaded even if that record is unused, where the contents // can still be initialized data. Know that for many record stores, deleting a record means // just setting one byte or bit in that record. record.setInUse( false ); cursor.setOffsetToMark(); }
public static <R extends AbstractBaseRecord> R inUse( R record ) { record.setInUse( true ); return record; }
public static <R extends AbstractBaseRecord> R notInUse( R record ) { record.setInUse( false ); return record; }
@Override protected void process( T[] batch, BatchSender sender ) { for ( T item : batch ) { if ( item != null && item.inUse() ) { if ( !processor.process( item ) ) { // No change for this record item.setInUse( false ); } } } // This step can be used in different stage settings, possible as the last step, // where nothing should be emitted if ( !endOfLine ) { sender.send( batch ); } }
private <RECORD extends AbstractBaseRecord> void createRecordIn( RecordStore<RECORD> store ) { RECORD record = store.newRecord(); record.setId( store.nextId() ); record.setInUse( true ); if ( record instanceof PropertyRecord ) { // Special hack for property store, since it's not enough to simply set a record as in use there PropertyBlock block = new PropertyBlock(); ((PropertyStore)store).encodeValue( block, 0, Values.of( 10 ) ); ((PropertyRecord) record).addPropertyBlock( block ); } store.updateRecord( record ); }
private void prepareForReading( PageCursor cursor, RECORD record ) { // Mark this record as unused. This to simplify implementations of readRecord. // readRecord can behave differently depending on RecordLoad argument and so it may be that // contents of a record may be loaded even if that record is unused, where the contents // can still be initialized data. Know that for many record stores, deleting a record means // just setting one byte or bit in that record. record.setInUse( false ); cursor.setOffsetToMark(); }
public static <R extends AbstractBaseRecord> R notInUse( R record ) { record.setInUse( false ); return record; }
public static <R extends AbstractBaseRecord> R inUse( R record ) { record.setInUse( true ); return record; }
@Override protected void process( T[] batch, BatchSender sender ) { for ( T item : batch ) { if ( item != null && item.inUse() ) { if ( !processor.process( item ) ) { // No change for this record item.setInUse( false ); } } } // This step can be used in different stage settings, possible as the last step, // where nothing should be emitted if ( !endOfLine ) { sender.send( batch ); } }