@JsonIgnore @Value.Lazy public String getClientOrThrow() { return client().orElseThrow(() -> new IllegalStateException( "Tried to read a client from a TimeLockClientConfig, but it hadn't been initialised.")); }
+ " atlas root-level namespace config.")); timelock().ifPresent(timelock -> timelock.client().ifPresent(client -> Preconditions.checkState(client.equals(namespaceConfigValue), "If present, the TimeLock client config should be the same as the" TimeLockClientConfig timeLockConfig = timelock().get(); Preconditions.checkState(timeLockConfig.client().isPresent(), "Either the atlas root-level namespace config or the TimeLock client config" + " should be present."); Preconditions.checkState(timeLockConfig.client().equals(Optional.of(keyValueServiceNamespace)), "AtlasDB refused to start, in order to avoid potential data corruption." + " Please contact AtlasDB support to remediate this. Specific steps are required;" keyValueService().getClass()); if (timelock().isPresent()) { return timelock().get().client() .orElseThrow(() -> new IllegalStateException("For InMemoryKVS, the TimeLock client should not be empty"));
private static Supplier<ServerListConfig> getServerListConfigSupplierForTimeLock( AtlasDbConfig config, Supplier<AtlasDbRuntimeConfig> runtimeConfigSupplier) { Preconditions.checkState(!remoteTimestampAndLockOrLeaderBlocksPresent(config), "Cannot create raw services from timelock with another source of timestamps/locks configured!"); TimeLockClientConfig clientConfig = config.timelock().orElse(ImmutableTimeLockClientConfig.builder().build()); String resolvedClient = OptionalResolver.resolve(clientConfig.client(), config.namespace()); return () -> ServerListConfigs.parseInstallAndRuntimeConfigs( clientConfig, () -> runtimeConfigSupplier.get().timelockRuntime(), resolvedClient); }
@JsonIgnore @Value.Lazy public String getClientOrThrow() { return client().orElseThrow(() -> new IllegalStateException( "Tried to read a client from a TimeLockClientConfig, but it hadn't been initialised.")); }
+ " atlas root-level namespace config.")); timelock().ifPresent(timelock -> timelock.client().ifPresent(client -> Preconditions.checkState(client.equals(namespaceConfigValue), "If present, the TimeLock client config should be the same as the" TimeLockClientConfig timeLockConfig = timelock().get(); Preconditions.checkState(timeLockConfig.client().isPresent(), "Either the atlas root-level namespace config or the TimeLock client config" + " should be present."); Preconditions.checkState(timeLockConfig.client().equals(Optional.of(keyValueServiceNamespace)), "AtlasDB refused to start, in order to avoid potential data corruption." + " Please contact AtlasDB support to remediate this. Specific steps are required;" keyValueService().getClass()); if (timelock().isPresent()) { return timelock().get().client() .orElseThrow(() -> new IllegalStateException("For InMemoryKVS, the TimeLock client should not be empty"));
private static Supplier<ServerListConfig> getServerListConfigSupplierForTimeLock( AtlasDbConfig config, Supplier<AtlasDbRuntimeConfig> runtimeConfigSupplier) { Preconditions.checkState(!remoteTimestampAndLockOrLeaderBlocksPresent(config), "Cannot create raw services from timelock with another source of timestamps/locks configured!"); TimeLockClientConfig clientConfig = config.timelock().orElse(ImmutableTimeLockClientConfig.builder().build()); String resolvedClient = OptionalResolver.resolve(clientConfig.client(), config.namespace()); return () -> ServerListConfigs.parseInstallAndRuntimeConfigs( clientConfig, () -> runtimeConfigSupplier.get().timelockRuntime(), resolvedClient); }