static void setupTables(KeyValueService kvs) { tearDownTables(kvs); TransactionTables.createTables(kvs); Schemas.createTablesAndIndexes(SweepSchema.INSTANCE.getLatestSchema(), kvs); }
@Override @Idempotent public synchronized void tryInitialize() { TransactionTables.createTables(keyValueService); createTablesAndIndexes(); populateLoggingContext(); }
@Provides @Singleton @Named("kvs") public KeyValueService provideWrappedKeyValueService(@Named("rawKvs") KeyValueService rawKvs, TimestampService tss, ServicesConfig config, MetricsManager metricsManager) { config.adapter().setTimestampService(tss); KvsProfilingLogger.setSlowLogThresholdMillis(config.atlasDbConfig().getKvsSlowLogThresholdMillis()); KeyValueService kvs = ProfilingKeyValueService.create(rawKvs); kvs = TracingKeyValueService.create(kvs); kvs = AtlasDbMetrics.instrument(metricsManager.getRegistry(), KeyValueService.class, kvs); kvs = ValidatingQueryRewritingKeyValueService.create(kvs); SweepConfig sweepConfig = config.atlasDbRuntimeConfig().sweep(); kvs = SweepStatsKeyValueService.create( kvs, tss, sweepConfig::writeThreshold, sweepConfig::writeSizeThreshold); TransactionTables.createTables(kvs); ImmutableSet<Schema> schemas = ImmutableSet.<Schema>builder() .add(SweepSchema.INSTANCE.getLatestSchema()) .add(CompactSchema.INSTANCE.getLatestSchema()) .addAll(config.schemas()).build(); for (Schema schema : schemas) { Schemas.createTablesAndIndexes(schema, kvs); } return kvs; }
private AtlasDbServices createMock(KeyValueService kvs) { TimestampService timestampService = new InMemoryTimestampService(); TransactionTables.createTables(kvs); TransactionService transactionService = spy(TransactionServices.createForTesting(kvs, timestampService, false));
TransactionTables.createTables(keyValueService);
@Before public void setUp() throws Exception { timestampService = new InMemoryTimestampService(); KeyValueService kvs = getBaseKeyValueService(); keyValueServiceWithStats = new StatsTrackingKeyValueService(kvs); keyValueService = spy(new TrackingKeyValueService(keyValueServiceWithStats)); TransactionTables.createTables(kvs); transactionService = TransactionServices.createForTesting(keyValueService, timestampService, false); conflictDetectionManager = ConflictDetectionManagers.createWithoutWarmingCache(keyValueService); sweepStrategyManager = SweepStrategyManagers.createDefault(keyValueService); sweepQueue = spy(TargetedSweeper.createUninitializedForTest(() -> sweepQueueShards)); serializableTxManager = new TestTransactionManagerImpl( metricsManager, keyValueService, timestampService, timestampService, lockClient, lockService, transactionService, conflictDetectionManager, sweepStrategyManager, sweepQueue, MoreExecutors.newDirectExecutorService()); sweepQueue.initialize(serializableTxManager); txManager = new CachingTestTransactionManager(serializableTxManager); }
@Override @Idempotent public synchronized void tryInitialize() { TransactionTables.createTables(keyValueService); createTablesAndIndexes(); populateLoggingContext(); }
static void setupTables(KeyValueService kvs) { tearDownTables(kvs); TransactionTables.createTables(kvs); Schemas.createTablesAndIndexes(SweepSchema.INSTANCE.getLatestSchema(), kvs); }
@Provides @Singleton @Named("kvs") public KeyValueService provideWrappedKeyValueService(@Named("rawKvs") KeyValueService rawKvs, TimestampService tss, ServicesConfig config, MetricsManager metricsManager) { config.adapter().setTimestampService(tss); KvsProfilingLogger.setSlowLogThresholdMillis(config.atlasDbConfig().getKvsSlowLogThresholdMillis()); KeyValueService kvs = ProfilingKeyValueService.create(rawKvs); kvs = TracingKeyValueService.create(kvs); kvs = AtlasDbMetrics.instrument(metricsManager.getRegistry(), KeyValueService.class, kvs); kvs = ValidatingQueryRewritingKeyValueService.create(kvs); SweepConfig sweepConfig = config.atlasDbRuntimeConfig().sweep(); kvs = SweepStatsKeyValueService.create( kvs, tss, sweepConfig::writeThreshold, sweepConfig::writeSizeThreshold); TransactionTables.createTables(kvs); ImmutableSet<Schema> schemas = ImmutableSet.<Schema>builder() .add(SweepSchema.INSTANCE.getLatestSchema()) .add(CompactSchema.INSTANCE.getLatestSchema()) .addAll(config.schemas()).build(); for (Schema schema : schemas) { Schemas.createTablesAndIndexes(schema, kvs); } return kvs; }
TransactionTables.createTables(keyValueService);