Skip to content

Commit

Permalink
Push creation of StoreFactory down into NeoStoreDataSource
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvest committed Nov 16, 2015
1 parent 8598951 commit 22df693
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
Expand Up @@ -414,7 +414,7 @@ boolean applicable( DiagnosticsPhase phase )
* core API are now slowly accumulating in the Kernel implementation. Over time, these components should be
* refactored into bigger components that wrap the very granular things we depend on here.
*/
public NeoStoreDataSource( File storeDir, Config config, StoreFactory sf, LogProvider logProvider,
public NeoStoreDataSource( File storeDir, Config config, IdGeneratorFactory idGeneratorFactory, LogProvider logProvider,
JobScheduler scheduler, TokenNameLookup tokenNameLookup, DependencyResolver dependencyResolver,
PropertyKeyTokenHolder propertyKeyTokens, LabelTokenHolder labelTokens,
RelationshipTypeTokenHolder relationshipTypeTokens, Locks lockManager,
Expand Down Expand Up @@ -460,7 +460,7 @@ public NeoStoreDataSource( File storeDir, Config config, StoreFactory sf, LogPro

readOnly = config.get( Configuration.read_only );
msgLog = logProvider.getLog( getClass() );
this.storeFactory = sf;
this.storeFactory = new StoreFactory( storeDir, config, idGeneratorFactory, pageCache, fs, logProvider );
this.lockService = new ReentrantLockService();
this.legacyIndexProviderLookup = new LegacyIndexProviderLookup()
{
Expand Down
Expand Up @@ -66,7 +66,6 @@
import org.neo4j.kernel.impl.logging.LogService;
import org.neo4j.kernel.impl.query.QueryEngineProvider;
import org.neo4j.kernel.impl.query.QueryExecutionEngine;
import org.neo4j.kernel.impl.store.StoreFactory;
import org.neo4j.kernel.impl.store.StoreId;
import org.neo4j.kernel.impl.storemigration.StoreMigrator;
import org.neo4j.kernel.impl.storemigration.StoreUpgrader;
Expand Down Expand Up @@ -163,8 +162,6 @@ public GraphDatabaseService getGraphDatabaseService()

// Factories for things that needs to be created later
PageCache pageCache = platformModule.pageCache;
StoreFactory storeFactory = new StoreFactory( storeDir, config, editionModule.idGeneratorFactory,
pageCache, fileSystem, logging.getInternalLogProvider() );

StartupStatisticsProvider startupStatistics = deps.satisfyDependency( new StartupStatisticsProvider() );

Expand All @@ -191,7 +188,7 @@ public GraphDatabaseService getGraphDatabaseService()
logging.getInternalLog( KernelHealth.class ) ) );

neoStoreDataSource = deps.satisfyDependency( new NeoStoreDataSource( storeDir, config,
storeFactory, logging.getInternalLogProvider(), platformModule.jobScheduler,
editionModule.idGeneratorFactory, logging.getInternalLogProvider(), platformModule.jobScheduler,
new NonTransactionalTokenNameLookup( editionModule.labelTokenHolder,
editionModule.relationshipTypeTokenHolder, editionModule.propertyKeyTokenHolder ),
deps, editionModule.propertyKeyTokenHolder, editionModule.labelTokenHolder, relationshipTypeTokenHolder,
Expand Down
Expand Up @@ -47,7 +47,6 @@
import org.neo4j.kernel.impl.core.StartupStatisticsProvider;
import org.neo4j.kernel.impl.factory.CommunityCommitProcessFactory;
import org.neo4j.kernel.impl.locking.Locks;
import org.neo4j.kernel.impl.store.StoreFactory;
import org.neo4j.kernel.impl.storemigration.StoreUpgrader;
import org.neo4j.kernel.impl.transaction.TransactionHeaderInformationFactory;
import org.neo4j.kernel.impl.transaction.TransactionMonitor;
Expand Down Expand Up @@ -78,21 +77,19 @@ public NeoStoreDataSource getDataSource( File storeDir, FileSystemAbstraction fs
final Config config = new Config( stringMap( additionalConfig ),
GraphDatabaseSettings.class );

StoreFactory sf = new StoreFactory( storeDir, config, new DefaultIdGeneratorFactory( fs ), pageCache, fs,
NullLogProvider.getInstance() );

Locks locks = mock( Locks.class );
when( locks.newClient() ).thenReturn( mock( Locks.Client.class ) );

dataSource = new NeoStoreDataSource( storeDir, config, sf, NullLogProvider.getInstance(),
dataSource = new NeoStoreDataSource( storeDir, config, new DefaultIdGeneratorFactory( fs ),
NullLogProvider.getInstance(),
mock( JobScheduler.class, RETURNS_MOCKS ), mock( TokenNameLookup.class ),
dependencyResolverForNoIndexProvider(), mock( PropertyKeyTokenHolder.class ),
mock( LabelTokenHolder.class ), mock( RelationshipTypeTokenHolder.class ), locks,
mock( SchemaWriteGuard.class ), mock( TransactionEventHandlers.class ), IndexingService.NO_MONITOR,
fs, mock( StoreUpgrader.class ), mock( TransactionMonitor.class ), kernelHealth,
mock( PhysicalLogFile.Monitor.class ), TransactionHeaderInformationFactory.DEFAULT,
new StartupStatisticsProvider(), mock( NodeManager.class ), null, null,
new CommunityCommitProcessFactory(), mock( PageCache.class ),
new CommunityCommitProcessFactory(), pageCache,
mock( ConstraintSemantics.class), new Monitors(), new Tracers( "null", NullLog.getInstance() ) );

return dataSource;
Expand Down

0 comments on commit 22df693

Please sign in to comment.