@Test public void require_that_empty_components_keys_after_bootstrap_returns_components_configs() { writeConfigs(); ConfigRetriever retriever = createConfigRetriever(); assertThat(retriever.getConfigs(Collections.emptySet(), 0), instanceOf(BootstrapConfigs.class)); assertThat(retriever.getConfigs(Collections.emptySet(), 0), instanceOf(ComponentsConfigs.class)); }
public ConfigSnapshot getConfigs(Set<ConfigKey<? extends ConfigInstance>> componentConfigKeys, long leastGeneration, boolean restartOnRedeploy) { while (true) { Optional<ConfigSnapshot> maybeSnapshot = getConfigsOnce(componentConfigKeys, leastGeneration, restartOnRedeploy); if (maybeSnapshot.isPresent()) { var configSnapshot = maybeSnapshot.get(); resetComponentSubscriberIfBootstrap(configSnapshot); return configSnapshot; } } }
ConfigRetriever { public ConfigSnapshot getConfigs(Set<ConfigKey<? extends ConfigInstance>> componentConfigKeys, long leastGeneration, boolean restartOnRedeploy) { while (true) { Optional<ConfigSnapshot> maybeSnapshot = getConfigsOnce(componentConfigKeys, leastGeneration, restartOnRedeploy); if (maybeSnapshot.isPresent()) { var configSnapshot = maybeSnapshot.get(); resetComponentSubscriberIfBootstrap(configSnapshot); return configSnapshot; } } } }
ConfigRetriever { public ConfigSnapshot getConfigs(Set<ConfigKey<? extends ConfigInstance>> componentConfigKeys, long leastGeneration, boolean restartOnRedeploy) { while (true) { Optional<ConfigSnapshot> maybeSnapshot = getConfigsOnce(componentConfigKeys, leastGeneration, restartOnRedeploy); if (maybeSnapshot.isPresent()) { var configSnapshot = maybeSnapshot.get(); resetComponentSubscriberIfBootstrap(configSnapshot); return configSnapshot; } } } ConfigRetriever(Set<ConfigKey<? extends ConfigInstance>> bootstrapKeys,
                           Function<Set<ConfigKey<? extends ConfigInstance>>, Subscriber> subscribe); }
ConfigRetriever { public ConfigSnapshot getConfigs(Set<ConfigKey<? extends ConfigInstance>> componentConfigKeys, long leastGeneration, boolean restartOnRedeploy) { while (true) { Optional<ConfigSnapshot> maybeSnapshot = getConfigsOnce(componentConfigKeys, leastGeneration, restartOnRedeploy); if (maybeSnapshot.isPresent()) { var configSnapshot = maybeSnapshot.get(); resetComponentSubscriberIfBootstrap(configSnapshot); return configSnapshot; } } } ConfigRetriever(Set<ConfigKey<? extends ConfigInstance>> bootstrapKeys,
                           Function<Set<ConfigKey<? extends ConfigInstance>>, Subscriber> subscribe); ConfigSnapshot getConfigs(Set<ConfigKey<? extends ConfigInstance>> componentConfigKeys,
                                     long leastGeneration,
                                     boolean restartOnRedeploy); void shutdown(); long getBootstrapGeneration(); long getComponentsGeneration(); }
ConfigRetriever { public ConfigSnapshot getConfigs(Set<ConfigKey<? extends ConfigInstance>> componentConfigKeys, long leastGeneration, boolean restartOnRedeploy) { while (true) { Optional<ConfigSnapshot> maybeSnapshot = getConfigsOnce(componentConfigKeys, leastGeneration, restartOnRedeploy); if (maybeSnapshot.isPresent()) { var configSnapshot = maybeSnapshot.get(); resetComponentSubscriberIfBootstrap(configSnapshot); return configSnapshot; } } } ConfigRetriever(Set<ConfigKey<? extends ConfigInstance>> bootstrapKeys,
                           Function<Set<ConfigKey<? extends ConfigInstance>>, Subscriber> subscribe); ConfigSnapshot getConfigs(Set<ConfigKey<? extends ConfigInstance>> componentConfigKeys,
                                     long leastGeneration,
                                     boolean restartOnRedeploy); void shutdown(); long getBootstrapGeneration(); long getComponentsGeneration();  }