@Override public void checkReference( NodeRecord node, LabelTokenRecord labelTokenRecord, CheckerEngine<NodeRecord, ConsistencyReport.NodeConsistencyReport> engine, RecordAccess records ) { if ( !labelTokenRecord.inUse() ) { engine.report().labelNotInUse( labelTokenRecord ); } }
private void writeLabelTokenRecord( WritableChannel channel, LabelTokenRecord record ) throws IOException { // id+in_use(byte)+type_blockId(int)+nr_type_records(int) byte inUse = record.inUse() ? Record.IN_USE.byteValue() : Record.NOT_IN_USE.byteValue(); channel.put( inUse ).putInt( record.getNameId() ); writeDynamicRecords( channel, record.getNameRecords() ); } }
@Override public LabelTokenRecord clone() { LabelTokenRecord labelTokenRecord = new LabelTokenRecord( getIntId() ); labelTokenRecord.setInUse( inUse() ); if ( isCreated() ) { labelTokenRecord.setCreated(); } labelTokenRecord.setNameId( getNameId() ); labelTokenRecord.addNameRecords( getNameRecords() ); return labelTokenRecord; } }
@Test public void forceGetRecordSkipInUsecheck() throws IOException { LabelTokenStore store = new UnusedLabelTokenStore(); LabelTokenRecord record = store.getRecord( 7, store.newRecord(), FORCE ); assertFalse( "Record should not be in use", record.inUse() ); }
private void writeLabelTokenRecord( WritableChannel channel, LabelTokenRecord record ) throws IOException { // id+in_use(byte)+type_blockId(int)+nr_type_records(int) byte inUse = record.inUse() ? Record.IN_USE.byteValue() : Record.NOT_IN_USE.byteValue(); channel.put( inUse ).putInt( record.getNameId() ); writeDynamicRecords( channel, record.getNameRecords() ); } }
@Override public LabelTokenRecord clone() { LabelTokenRecord labelTokenRecord = new LabelTokenRecord( getIntId() ); labelTokenRecord.setInUse( inUse() ); if ( isCreated() ) { labelTokenRecord.setCreated(); } labelTokenRecord.setNameId( getNameId() ); labelTokenRecord.addNameRecords( getNameRecords() ); return labelTokenRecord; } }