private void removeProvidersFromIndexDbFile( DatabaseLayout databaseLayout ) { IndexConfigStore indexStore = new IndexConfigStore( databaseLayout, fileSystemRule.get() ); for ( Class<? extends PropertyContainer> cls : new Class[] {Node.class, Relationship.class} ) { for ( String name : indexStore.getNames( cls ) ) { Map<String, String> config = indexStore.get( cls, name ); config = new HashMap<>( config ); config.remove( IndexManager.PROVIDER ); indexStore.set( Node.class, name, config ); } } } }
@Before public void setUp() { indexStore = new IndexConfigStore( directory.databaseLayout(), fileSystemRule.get() ); addIndex( "foo" ); }
private void setupIndexInfrastructure() { indexStore = new IndexConfigStore( testDirectory.databaseLayout(), fileSystemRule.get() ); indexStore.set( Node.class, INDEX_NAME, MapUtil.stringMap( IndexManager.PROVIDER, "lucene", "type", "fulltext" ) ); } }
private IndexConfigStore newIndexConfigStore( MutableObjectIntMap<String> names, String providerName ) { EphemeralFileSystemAbstraction fileSystem = fs.get(); IndexConfigStore store = life.add( new IndexConfigStore( testDirectory.databaseLayout(), fileSystem ) ); names.forEachKey( name -> { store.set( Node.class, name, stringMap( IndexManager.PROVIDER, providerName ) ); store.set( Relationship.class, name, stringMap( IndexManager.PROVIDER, providerName ) ); } ); return store; } }
private RecordStorageEngine get( FileSystemAbstraction fs, PageCache pageCache, IndexProvider indexProvider, DatabaseHealth databaseHealth, DatabaseLayout databaseLayout, Function<BatchTransactionApplierFacade, BatchTransactionApplierFacade> transactionApplierTransformer, Monitors monitors, LockService lockService ) { IdGeneratorFactory idGeneratorFactory = new EphemeralIdGenerator.Factory(); ExplicitIndexProvider explicitIndexProviderLookup = mock( ExplicitIndexProvider.class ); when( explicitIndexProviderLookup.allIndexProviders() ).thenReturn( Iterables.empty() ); IndexConfigStore indexConfigStore = new IndexConfigStore( databaseLayout, fs ); JobScheduler scheduler = life.add( createScheduler() ); Config config = Config.defaults( GraphDatabaseSettings.default_schema_provider, indexProvider.getProviderDescriptor().name() ); Dependencies dependencies = new Dependencies(); dependencies.satisfyDependency( indexProvider ); BufferingIdGeneratorFactory bufferingIdGeneratorFactory = new BufferingIdGeneratorFactory( idGeneratorFactory, IdReuseEligibility.ALWAYS, new CommunityIdTypeConfigurationProvider() ); DefaultIndexProviderMap indexProviderMap = new DefaultIndexProviderMap( dependencies, config ); NullLogProvider nullLogProvider = NullLogProvider.getInstance(); life.add( indexProviderMap ); return life.add( new ExtendedRecordStorageEngine( databaseLayout, config, pageCache, fs, nullLogProvider, nullLogProvider, mockedTokenHolders(), mock( SchemaState.class ), new StandardConstraintSemantics(), scheduler, mock( TokenNameLookup.class ), lockService, indexProviderMap, IndexingService.NO_MONITOR, databaseHealth, explicitIndexProviderLookup, indexConfigStore, new SynchronizedArrayIdOrderingQueue(), idGeneratorFactory, new BufferedIdController( bufferingIdGeneratorFactory, scheduler ), transactionApplierTransformer, monitors, RecoveryCleanupWorkCollector.immediate(), OperationalMode.single ) ); }
String key = "key"; DatabaseLayout databaseLayout = testDirectory.databaseLayout(); IndexConfigStore configStore = new IndexConfigStore( databaseLayout, fs ); configStore.set( Node.class, indexName, EXACT_CONFIG ); try ( Lifespan lifespan = new Lifespan() )
private void setupIndexInfrastructure() throws Exception { DatabaseLayout databaseLayout = testDirectory.databaseLayout(); indexStore = new IndexConfigStore( databaseLayout, fileSystemRule.get() ); indexStore.set( Node.class, INDEX_NAME, MapUtil.stringMap( IndexManager.PROVIDER, "lucene", "type", "fulltext" ) ); LuceneDataSource luceneDataSource = new LuceneDataSource( databaseLayout, Config.defaults(), indexStore, fileSystemRule.get(), OperationalMode.single ); try { luceneDataSource.init(); luceneDataSource.getIndexSearcher( indexIdentifier ); } finally { luceneDataSource.shutdown(); } }
@Test public void recoveryForRelationshipCommandsOnly() throws Throwable { // shutdown db here DatabaseLayout databaseLayout = db.databaseLayout(); shutdownDB(); try ( Transaction tx = db.beginTx() ) { Index<Relationship> index = db.index().forRelationships( "myIndex" ); Node node = db.createNode(); Relationship relationship = db.createNode().createRelationshipTo( node, RelationshipType.withName( "KNOWS" ) ); index.add( relationship, "key", "value" ); tx.success(); } db.shutdown(); Config config = Config.defaults(); IndexConfigStore indexStore = new IndexConfigStore( databaseLayout, fileSystemRule.get() ); LuceneDataSource ds = new LuceneDataSource( databaseLayout, config, indexStore, fileSystemRule.get(), OperationalMode.single ); ds.start(); ds.stop(); }
tokenHolders = new TokenHolders( propertyKeyTokenHolder, labelTokenHolder, relationshipTypeTokenHolder ); indexStore = life.add( new IndexConfigStore( this.databaseLayout, fileSystem ) ); schemaCache = new SchemaCache( loadConstraintSemantics(), schemaStore, indexProviderMap );
this.commitProcessFactory = editionContext.getCommitProcessFactory(); this.autoIndexing = new InternalAutoIndexing( platformModule.config, tokenHolders.propertyKeyTokens() ); this.indexConfigStore = new IndexConfigStore( databaseLayout, fs ); this.explicitIndexProvider = new DefaultExplicitIndexProvider(); this.pageCache = platformModule.pageCache;
tokenHolders = new TokenHolders( propertyKeyTokenHolder, labelTokenHolder, relationshipTypeTokenHolder ); indexStore = life.add( new IndexConfigStore( this.databaseLayout, fileSystem ) ); schemaCache = new SchemaCache( loadConstraintSemantics(), schemaStore, indexProviderMap );
this.commitProcessFactory = editionContext.getCommitProcessFactory(); this.autoIndexing = new InternalAutoIndexing( platformModule.config, tokenHolders.propertyKeyTokens() ); this.indexConfigStore = new IndexConfigStore( databaseLayout, fs ); this.explicitIndexProvider = new DefaultExplicitIndexProvider(); this.pageCache = platformModule.pageCache;