/** * Create a {@link TransactionManager} backed by an * {@link com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService}. This should be used for testing * purposes only. */ public static TransactionManager createInMemory(Set<Schema> schemas) { AtlasDbConfig config = ImmutableAtlasDbConfig.builder().keyValueService(new InMemoryAtlasDbConfig()).build(); return builder() .config(config) .userAgent(UserAgents.DEFAULT_USER_AGENT) .globalMetricsRegistry(new MetricRegistry()) .globalTaggedMetricRegistry(DefaultTaggedMetricRegistry.getDefault()) .addAllSchemas(schemas) .build() .serializable(); }
/** * Create a {@link TransactionManager} backed by an * {@link com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService}. This should be used for testing * purposes only. */ public static TransactionManager createInMemory(Set<Schema> schemas) { AtlasDbConfig config = ImmutableAtlasDbConfig.builder().keyValueService(new InMemoryAtlasDbConfig()).build(); return builder() .config(config) .userAgent(UserAgents.DEFAULT_USER_AGENT) .globalMetricsRegistry(new MetricRegistry()) .globalTaggedMetricRegistry(DefaultTaggedMetricRegistry.getDefault()) .addAllSchemas(schemas) .build() .serializable(); }
@SuppressWarnings("OptionalUsedAsFieldOrParameterType") private TransactionManager createTransactionManager(AtlasDbConfig config, Optional<AtlasDbRuntimeConfig> atlasDbRuntimeConfigOptional, Environment environment, TaggedMetricRegistry taggedMetricRegistry) { return TransactionManagers.builder() .config(config) .userAgent("ete test") .globalMetricsRegistry(environment.metrics()) .globalTaggedMetricRegistry(taggedMetricRegistry) .registrar(environment.jersey()::register) .addAllSchemas(ETE_SCHEMAS) .runtimeConfigSupplier(() -> atlasDbRuntimeConfigOptional) .build() .serializable(); }