@Override public int reservePropertyKeyTokenId() { return toIntExact( neoStores.getPropertyKeyTokenStore().nextId() ); }
@Override public boolean visitPropertyKeyTokenCommand( Command.PropertyKeyTokenCommand command ) { updateStore( neoStores.getPropertyKeyTokenStore(), command ); return false; }
@Override public boolean visitPropertyKeyTokenCommand( PropertyKeyTokenCommand command ) { trackToken( neoStores.getPropertyKeyTokenStore(), command ); return false; }
public CacheInvalidationTransactionApplier( NeoStores neoStores, CacheAccessBackDoor cacheAccess ) { this.cacheAccess = cacheAccess; this.relationshipTypeTokenStore = neoStores.getRelationshipTypeTokenStore(); this.labelTokenStore = neoStores.getLabelTokenStore(); this.propertyKeyTokenStore = neoStores.getPropertyKeyTokenStore(); }
/** * Creates a property index entry out of the given id and string. * * @param key The key of the property index, as a string. * @param id The property index record id. */ void createPropertyKeyToken( String key, long id ) { TokenCreator<PropertyKeyTokenRecord> creator = new TokenCreator<>( neoStores.getPropertyKeyTokenStore() ); creator.createToken( key, id, recordChangeSet.getPropertyKeyTokenChanges() ); }
@Before public void setup() { when( neoStores.getMetaDataStore() ).thenReturn( metaDataStore ); when( neoStores.getNodeStore() ).thenReturn( nodeStore ); when( neoStores.getRelationshipStore() ).thenReturn( relationshipStore ); when( neoStores.getPropertyStore() ).thenReturn( propertyStore ); when( neoStores.getRelationshipGroupStore() ).thenReturn( relationshipGroupStore ); when( neoStores.getRelationshipTypeTokenStore() ).thenReturn( relationshipTypeTokenStore ); when( neoStores.getLabelTokenStore() ).thenReturn( labelTokenStore ); when( neoStores.getPropertyKeyTokenStore() ).thenReturn( propertyKeyTokenStore ); when( neoStores.getSchemaStore() ).thenReturn( schemaStore ); when( nodeStore.getDynamicLabelStore() ).thenReturn( dynamicLabelStore ); when( lockService.acquireNodeLock( anyLong(), any() ) ) .thenReturn( LockService.NO_LOCK ); when( lockService.acquireRelationshipLock( anyLong(), any() ) ) .thenReturn( LockService.NO_LOCK ); when( transactionToApply.transactionId() ).thenReturn( transactionId ); }
public DirectRecordAccessSet( NeoStores neoStores ) { this( neoStores.getNodeStore(), neoStores.getPropertyStore(), neoStores.getRelationshipStore(), neoStores.getRelationshipGroupStore(), neoStores.getPropertyKeyTokenStore(), neoStores.getRelationshipTypeTokenStore(), neoStores.getLabelTokenStore(), neoStores.getSchemaStore() ); }
public Loaders( NeoStores neoStores ) { this( neoStores.getNodeStore(), neoStores.getPropertyStore(), neoStores.getRelationshipStore(), neoStores.getRelationshipGroupStore(), neoStores.getPropertyKeyTokenStore(), neoStores.getRelationshipTypeTokenStore(), neoStores.getLabelTokenStore(), neoStores.getSchemaStore() ); }
private long nextId( Class<?> clazz ) { NeoStores neoStores = ds.getDependencyResolver() .resolveDependency( RecordStorageEngine.class ).testAccessNeoStores(); if ( clazz.equals( PropertyKeyTokenRecord.class ) ) { return neoStores.getPropertyKeyTokenStore().nextId(); } if ( clazz.equals( RelationshipType.class ) ) { return neoStores.getRelationshipTypeTokenStore().nextId(); } if ( clazz.equals( Node.class ) ) { return neoStores.getNodeStore().nextId(); } if ( clazz.equals( Relationship.class ) ) { return neoStores.getRelationshipStore().nextId(); } throw new IllegalArgumentException( clazz.getName() ); }
private void instantiateStores() { neoStores = newStoreFactory( databaseLayout ).openAllNeoStores( true ); propertyKeyRepository = new BatchingPropertyKeyTokenRepository( neoStores.getPropertyKeyTokenStore() ); labelRepository = new BatchingLabelTokenRepository( neoStores.getLabelTokenStore() ); relationshipTypeRepository = new BatchingRelationshipTypeTokenRepository( neoStores.getRelationshipTypeTokenStore() ); temporaryNeoStores = instantiateTempStores(); instantiateKernelExtensions(); // Delete the id generators because makeStoreOk isn't atomic in the sense that there's a possibility of an unlucky timing such // that if the process is killed at the right time some store may end up with a .id file that looks to be CLEAN and has highId=0, // i.e. effectively making the store look empty on the next start. Normal recovery of a db is sort of protected by this recovery // recognizing that the db needs recovery when it looks at the tx log and also calling deleteIdGenerators. In the import case // there are no tx logs at all, and therefore we do this manually right here. neoStores.deleteIdGenerators(); temporaryNeoStores.deleteIdGenerators(); neoStores.makeStoreOk(); temporaryNeoStores.makeStoreOk(); }
@Override public void start() throws Throwable { neoStores.makeStoreOk(); tokenHolders.propertyKeyTokens().setInitialTokens( neoStores.getPropertyKeyTokenStore().getTokens() ); tokenHolders.relationshipTypeTokens().setInitialTokens( neoStores.getRelationshipTypeTokenStore().getTokens() ); tokenHolders.labelTokens().setInitialTokens( neoStores.getLabelTokenStore().getTokens() ); neoStores.startCountStore(); // TODO: move this to counts store lifecycle loadSchemaCache(); indexingService.start(); labelScanStore.start(); idController.start(); }
.openNeoStores( true, StoreType.PROPERTY_KEY_TOKEN, StoreType.PROPERTY_KEY_TOKEN_NAME ) ) TokenStore<PropertyKeyTokenRecord> tokenStore = stores.getPropertyKeyTokenStore(); int rounds = 3; int tokensPerRound = 4;
tokenHolders.propertyKeyTokens().setInitialTokens( neoStores.getPropertyKeyTokenStore().getTokens() ); tokenHolders.labelTokens().setInitialTokens( neoStores.getLabelTokenStore().getTokens() ); tokenHolders.relationshipTypeTokens().setInitialTokens( neoStores.getRelationshipTypeTokenStore().getTokens() );
relationshipStore = neoStores.getRelationshipStore(); relationshipTypeTokenStore = neoStores.getRelationshipTypeTokenStore(); propertyKeyTokenStore = neoStores.getPropertyKeyTokenStore(); propertyStore = neoStores.getPropertyStore(); RecordStore<RelationshipGroupRecord> relationshipGroupStore = neoStores.getRelationshipGroupStore();
private GraphDatabaseAPI databaseWithManyPropertyKeys( int propertyKeyCount ) { PageCache pageCache = pageCacheRule.getPageCache( fileSystemRule.get() ); StoreFactory storeFactory = new StoreFactory( testDirectory.databaseLayout(), Config.defaults(), new DefaultIdGeneratorFactory( fileSystemRule.get() ), pageCache, fileSystemRule.get(), NullLogProvider.getInstance(), EmptyVersionContextSupplier.EMPTY ); NeoStores neoStores = storeFactory.openAllNeoStores( true ); PropertyKeyTokenStore store = neoStores.getPropertyKeyTokenStore(); for ( int i = 0; i < propertyKeyCount; i++ ) { PropertyKeyTokenRecord record = new PropertyKeyTokenRecord( (int) store.nextId() ); record.setInUse( true ); Collection<DynamicRecord> nameRecords = store.allocateNameRecords( PropertyStore.encodeString( key( i ) ) ); record.addNameRecords( nameRecords ); record.setNameId( (int) Iterables.first( nameRecords ).getId() ); store.updateRecord( record ); } neoStores.close(); return database(); }
assertEquals( "RelationshipType NameStore", 1 + 1, neoStores.getRelationshipTypeTokenStore().getNameStore().getHighId() ); assertEquals( "PropertyKeyStore", 5 + 1, neoStores.getPropertyKeyTokenStore().getHighId() ); assertEquals( "PropertyKey NameStore", 1 + 1, neoStores.getPropertyKeyTokenStore().getNameStore().getHighId() ); assertEquals( "LabelStore", 5 + 1, neoStores.getLabelTokenStore().getHighId() ); assertEquals( "Label NameStore", 1 + 1, neoStores.getLabelTokenStore().getNameStore().getHighId() );
@Override public boolean visitPropertyKeyTokenCommand( PropertyKeyTokenCommand command ) { trackToken( neoStores.getPropertyKeyTokenStore(), command ); return false; }
@Override public int reservePropertyKeyTokenId() { return toIntExact( neoStores.getPropertyKeyTokenStore().nextId() ); }
public DirectRecordAccessSet( NeoStores neoStores ) { this( neoStores.getNodeStore(), neoStores.getPropertyStore(), neoStores.getRelationshipStore(), neoStores.getRelationshipGroupStore(), neoStores.getPropertyKeyTokenStore(), neoStores.getRelationshipTypeTokenStore(), neoStores.getLabelTokenStore(), neoStores.getSchemaStore() ); }
public Loaders( NeoStores neoStores ) { this( neoStores.getNodeStore(), neoStores.getPropertyStore(), neoStores.getRelationshipStore(), neoStores.getRelationshipGroupStore(), neoStores.getPropertyKeyTokenStore(), neoStores.getRelationshipTypeTokenStore(), neoStores.getLabelTokenStore(), neoStores.getSchemaStore() ); }