Skip to content

Commit

Permalink
Review comments: renaming, private constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaDemianenko committed Aug 30, 2018
1 parent 90ce5a4 commit efcdebd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
Expand Up @@ -750,7 +750,7 @@ protected void create(
GraphDatabaseFacadeFactory.Dependencies dependencies )
{
Function<PlatformModule,EditionModule> factory =
platformModule -> new CommunityEditionModuleWithCustomIdModule( platformModule, idFactory );
platformModule -> new CommunityEditionModuleWithCustomIdContextFactory( platformModule, idFactory );
new GraphDatabaseFacadeFactory( DatabaseInfo.COMMUNITY, factory )
{

Expand Down Expand Up @@ -780,9 +780,9 @@ private Node createNode( GraphDatabaseService db, Label... labels )
}
}

private static class CommunityEditionModuleWithCustomIdModule extends CommunityEditionModule
private static class CommunityEditionModuleWithCustomIdContextFactory extends CommunityEditionModule
{
CommunityEditionModuleWithCustomIdModule( PlatformModule platformModule, EphemeralIdGenerator.Factory idFactory )
CommunityEditionModuleWithCustomIdContextFactory( PlatformModule platformModule, EphemeralIdGenerator.Factory idFactory )
{
super( platformModule );
idContextFactory = IdContextFactoryBuilder.of( platformModule.fileSystem, platformModule.jobScheduler )
Expand Down
Expand Up @@ -101,7 +101,7 @@ public CommunityEditionModule( PlatformModule platformModule )
threadToTransactionBridge = dependencies.satisfyDependency(
new ThreadToStatementContextBridge( getGlobalAvailabilityGuard( platformModule.clock, logging, platformModule.config ) ) );

idContextFactory = createIdModule( platformModule, fileSystem );
idContextFactory = createIdContextFactory( platformModule, fileSystem );

tokenHoldersSupplier = () -> new TokenHolders(
new DelegatingTokenHolder( createPropertyKeyCreator( config, dataSourceManager ), TokenHolder.TYPE_PROPERTY_KEY ),
Expand All @@ -128,7 +128,7 @@ public CommunityEditionModule( PlatformModule platformModule )
publishEditionInfo( dependencies.resolveDependency( UsageData.class ), platformModule.databaseInfo, config );
}

protected IdContextFactory createIdModule( PlatformModule platformModule, FileSystemAbstraction fileSystem )
protected IdContextFactory createIdContextFactory( PlatformModule platformModule, FileSystemAbstraction fileSystem )
{
return IdContextFactoryBuilder.of( fileSystem, platformModule.jobScheduler ).build();
}
Expand Down
Expand Up @@ -41,6 +41,10 @@ public class IdContextFactoryBuilder
private IdTypeConfigurationProvider idTypeConfigurationProvider;
private Function<IdGeneratorFactory,IdGeneratorFactory> factoryWrapper;

private IdContextFactoryBuilder()
{
}

public static IdContextFactoryBuilder of( IdTypeConfigurationProvider configurationProvider, JobScheduler jobScheduler )
{
IdContextFactoryBuilder builder = new IdContextFactoryBuilder();
Expand Down
Expand Up @@ -305,7 +305,7 @@ public EnterpriseCoreEditionModule( final PlatformModule platformModule,
consensusModule.raftMachine(), dependencies, localDatabase );

idContextFactory = IdContextFactoryBuilder.of( coreStateMachinesModule.idTypeConfigurationProvider, platformModule.jobScheduler )
.withIdGenerationFactoryProvider( databaseName -> coreStateMachinesModule.idGeneratorFactory )
.withIdGenerationFactoryProvider( ignored -> coreStateMachinesModule.idGeneratorFactory )
.withFactoryWrapper( generator -> new FreeIdFilteredIdGeneratorFactory( generator, coreStateMachinesModule.freeIdCondition ) ).build();

// TODO: this is broken, coreStateMachinesModule.tokenHolders should be supplier, somehow...
Expand Down
Expand Up @@ -74,7 +74,7 @@ public EnterpriseEditionModule( PlatformModule platformModule )
}

@Override
protected IdContextFactory createIdModule( PlatformModule platformModule, FileSystemAbstraction fileSystem )
protected IdContextFactory createIdContextFactory( PlatformModule platformModule, FileSystemAbstraction fileSystem )
{
return IdContextFactoryBuilder.of( new EnterpriseIdTypeConfigurationProvider( platformModule.config ), platformModule.jobScheduler )
.withFileSystem( fileSystem )
Expand Down
Expand Up @@ -724,7 +724,7 @@ private class TransactionGuardTerminationEditionModule extends EnterpriseEdition
}

@Override
protected IdContextFactory createIdModule( PlatformModule platformModule, FileSystemAbstraction fileSystem )
protected IdContextFactory createIdContextFactory( PlatformModule platformModule, FileSystemAbstraction fileSystem )
{
return IdContextFactoryBuilder.of( new EnterpriseIdTypeConfigurationProvider( platformModule.config ),
platformModule.jobScheduler )
Expand Down

0 comments on commit efcdebd

Please sign in to comment.