use of com.palantir.timelock.config.RestrictedTimeLockRuntimeConfiguration in project atlasdb by palantir.
the class TimeLockAgent method create.
// Legacy
@SuppressWarnings("TooManyArguments")
public static TimeLockAgent create(MetricsManager metricsManager, TimeLockInstallConfiguration install, Refreshable<TimeLockRuntimeConfiguration> runtime, ClusterConfiguration cluster, UserAgent userAgent, int threadPoolSize, long blockingTimeoutMs, Consumer<Object> registrar, Optional<Consumer<UndertowService>> undertowRegistrar, OrderableSlsVersion timeLockVersion, ObjectMapper objectMapper, Runnable serviceStopper) {
verifyConfigurationSanity(install, cluster);
// Restricting access to user-provided runtime config
Refreshable<TimeLockRuntimeConfiguration> restrictedRuntime = runtime.map(RestrictedTimeLockRuntimeConfiguration::new);
TimeLockDialogueServiceProvider timeLockDialogueServiceProvider = createTimeLockDialogueServiceProvider(metricsManager, cluster, userAgent);
PaxosResourcesFactory.TimelockPaxosInstallationContext installationContext = ImmutableTimelockPaxosInstallationContext.of(install, cluster, userAgent, timeLockDialogueServiceProvider, timeLockVersion);
// Upgrading the schema version should generally happen BEFORE any migration has started. Keep this in
// mind for any potential live migrations
PersistedSchemaVersion persistedSchemaVersion = PersistedSchemaVersion.create(installationContext.sqliteDataSource());
persistedSchemaVersion.upgradeVersion(SCHEMA_VERSION);
verifySchemaVersion(persistedSchemaVersion);
verifyTimestampBoundPersisterConfiguration(installationContext.sqliteDataSource(), install.timestampBoundPersistence(), install.iAmOnThePersistenceTeamAndKnowWhatIAmDoingReseedPersistedPersisterConfiguration(), objectMapper);
PaxosResources paxosResources = PaxosResourcesFactory.create(installationContext, metricsManager, Suppliers.compose(TimeLockRuntimeConfiguration::paxos, restrictedRuntime::get));
AllNodesDisabledNamespacesUpdaterFactory updaterFactory = new AllNodesDisabledNamespacesUpdaterFactory(installationContext, metricsManager);
TimeLockAgent agent = new TimeLockAgent(metricsManager, install, restrictedRuntime, cluster, undertowRegistrar, threadPoolSize, blockingTimeoutMs, registrar, paxosResources, updaterFactory, userAgent, persistedSchemaVersion, installationContext.sqliteDataSource(), serviceStopper);
agent.createAndRegisterResources();
return agent;
}
Aggregations