ServiceDiscoveringAtlasSupplier { public synchronized ManagedTimestampService getManagedTimestampService() { log.info("[timestamp-service-creation] Fetching timestamp service from " + "thread {}. This should only happen once.", Thread.currentThread().getName()); if (timestampServiceCreationInfo == null) { timestampServiceCreationInfo = ThreadDumps.programmaticThreadDump(); } else { handleMultipleTimestampFetch(); } return timestampService.get(); } ServiceDiscoveringAtlasSupplier(
            MetricsManager metricsManager,
            KeyValueServiceConfig config,
            Supplier<Optional<KeyValueServiceRuntimeConfig>> runtimeConfig,
            Optional<LeaderConfig> leaderConfig,
            Optional<String> namespace,
            Optional<TableReference> timestampTable,
            boolean initializeAsync,
            LongSupplier timestampSupplier); KeyValueService getKeyValueService(); synchronized ManagedTimestampService getManagedTimestampService(); synchronized TimestampStoreInvalidator getTimestampStoreInvalidator();  }
@Test public void returnDifferentTimestampServicesOnSubsequentCalls() { ServiceDiscoveringAtlasSupplier supplier = createAtlasSupplier(kvsConfig); AutoServiceAnnotatedAtlasDbFactory.nextTimestampServiceToReturn( mock(ManagedTimestampService.class), mock(ManagedTimestampService.class)); assertThat(supplier.getManagedTimestampService()) .as("Need to get a newly-initialized timestamp service in case leadership changed between calls") .isNotSameAs(supplier.getManagedTimestampService()); }