use of com.palantir.atlasdb.internalschema.ReadOnlyTransactionSchemaManager in project atlasdb by palantir.
the class TransactionServices method createReadOnlyTransactionServiceIgnoresUncommittedTransactionsDoesNotRollBack.
public static TransactionService createReadOnlyTransactionServiceIgnoresUncommittedTransactionsDoesNotRollBack(KeyValueService keyValueService, MetricsManager metricsManager) {
if (keyValueService.supportsCheckAndSet()) {
CoordinationService<InternalSchemaMetadata> coordinationService = CoordinationServices.createDefault(keyValueService, () -> {
throw new SafeIllegalStateException("Attempted to get a timestamp from a read-only" + " transaction service! This is probably a product bug. Please contact" + " support.");
}, metricsManager, false);
ReadOnlyTransactionSchemaManager readOnlyTransactionSchemaManager = new ReadOnlyTransactionSchemaManager(coordinationService);
return new PreStartHandlingTransactionService(new SplitKeyDelegatingTransactionService<>(readOnlyTransactionSchemaManager::getTransactionsSchemaVersion, ImmutableMap.of(1, createV1TransactionService(keyValueService))));
}
return createV1TransactionService(keyValueService);
}
Aggregations