@Override public PropertyKeyTokenRecord clone() { PropertyKeyTokenRecord propertyKeyTokenRecord = new PropertyKeyTokenRecord( getIntId() ); propertyKeyTokenRecord.setInUse( inUse() ); if ( isCreated() ) { propertyKeyTokenRecord.setCreated(); } propertyKeyTokenRecord.setNameId( getNameId() ); propertyKeyTokenRecord.addNameRecords( getNameRecords() ); propertyKeyTokenRecord.setPropertyCount( getPropertyCount() ); return propertyKeyTokenRecord; } }
private int createNewPropertyKeyId( String stringKey ) { int keyId = (int) propertyKeyTokenStore.nextId(); PropertyKeyTokenRecord record = new PropertyKeyTokenRecord( keyId ); record.setInUse( true ); record.setCreated(); Collection<DynamicRecord> keyRecords = propertyKeyTokenStore.allocateNameRecords( encodeString( stringKey ) ); record.setNameId( (int) Iterables.first( keyRecords ).getId() ); record.addNameRecords( keyRecords ); propertyKeyTokenStore.updateRecord( record ); tokenHolders.propertyKeyTokens().addToken( new NamedToken( stringKey, keyId ) ); return keyId; }
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(); }
@Override public PropertyKeyTokenRecord clone() { PropertyKeyTokenRecord propertyKeyTokenRecord = new PropertyKeyTokenRecord( getIntId() ); propertyKeyTokenRecord.setInUse( inUse() ); if ( isCreated() ) { propertyKeyTokenRecord.setCreated(); } propertyKeyTokenRecord.setNameId( getNameId() ); propertyKeyTokenRecord.addNameRecords( getNameRecords() ); propertyKeyTokenRecord.setPropertyCount( getPropertyCount() ); return propertyKeyTokenRecord; } }
private int createNewPropertyKeyId( String stringKey ) { int keyId = (int) propertyKeyTokenStore.nextId(); PropertyKeyTokenRecord record = new PropertyKeyTokenRecord( keyId ); record.setInUse( true ); record.setCreated(); Collection<DynamicRecord> keyRecords = propertyKeyTokenStore.allocateNameRecords( encodeString( stringKey ) ); record.setNameId( (int) Iterables.first( keyRecords ).getId() ); record.addNameRecords( keyRecords ); propertyKeyTokenStore.updateRecord( record ); tokenHolders.propertyKeyTokens().addToken( new NamedToken( stringKey, keyId ) ); return keyId; }