@Override public long nextId() { return actual.nextId(); }
public long newRuleId() { return schemaStore.nextId(); }
@Override public long visit( long nodeId, int typeId, long out, long in, long loop ) { long id = store.nextId(); RelationshipGroupRecord record = batch[cursor++]; record.setId( id ); record.initialize( true, typeId, out, in, loop, nodeId, loop ); if ( cursor == batchSize ) { send(); batch = control.reuse( this ); cursor = 0; } return id; }
final AtomicLong nextId = new AtomicLong(); RecordStore<RelationshipGroupRecord> store = mock( RecordStore.class ); when( store.nextId() ).thenAnswer( invocation -> nextId.incrementAndGet() ); doAnswer( invocation ->
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 ); }
groupRecord.setId( groupStore.nextId() ); groupStore.updateRecord( groupRecord );
@Test public void shouldReportRelationshipTypeInconsistencies() throws Exception { // given StoreAccess access = fixture.directStoreAccess().nativeStores(); RecordStore<RelationshipTypeTokenRecord> relTypeStore = access.getRelationshipTypeTokenStore(); RelationshipTypeTokenRecord record = relTypeStore.getRecord( (int) relTypeStore.nextId(), relTypeStore.newRecord(), FORCE ); record.setNameId( 20 ); record.setInUse( true ); relTypeStore.updateRecord( record ); // when ConsistencySummaryStatistics stats = check(); // then access.close(); on( stats ).verify( RecordType.RELATIONSHIP_TYPE, 1 ) .andThatsAllFolks(); }
groupRecord.setId( groupStore.nextId() ); groupStore.updateRecord( groupRecord );
@Override public long nextId() { return actual.nextId(); }
public long newRuleId() { return schemaStore.nextId(); }
@Override public long visit( long nodeId, int typeId, long out, long in, long loop ) { long id = store.nextId(); RelationshipGroupRecord record = batch[cursor++]; record.setId( id ); record.initialize( true, typeId, out, in, loop, nodeId, loop ); if ( cursor == batchSize ) { send(); batch = control.reuse( this ); cursor = 0; } return id; }
@Test public void shouldReportRelationshipTypeInconsistencies() throws Exception { // given StoreAccess access = fixture.directStoreAccess().nativeStores(); RecordStore<RelationshipTypeTokenRecord> relTypeStore = access.getRelationshipTypeTokenStore(); RelationshipTypeTokenRecord record = relTypeStore.forceGetRecord( (int) relTypeStore.nextId() ); record.setNameId( 20 ); record.setInUse( true ); relTypeStore.updateRecord( record ); // when ConsistencySummaryStatistics stats = check( fixture.directStoreAccess() ); // then access.close(); on( stats ).verify( RecordType.RELATIONSHIP_TYPE, 1 ) .andThatsAllFolks(); }