public static TransactionService createReadOnlyTransactionServiceIgnoresUncommittedTransactionsDoesNotRollBack( KeyValueService keyValueService) { 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."); }, false); ReadOnlyTransactionSchemaManager readOnlyTransactionSchemaManager = new ReadOnlyTransactionSchemaManager(coordinationService); return new PreStartHandlingTransactionService( new SplitKeyDelegatingTransactionService<>( readOnlyTransactionSchemaManager::getTransactionsSchemaVersion, ImmutableMap.of(1, createV1TransactionService(keyValueService)))); } return createV1TransactionService(keyValueService); } }
public static TransactionService createReadOnlyTransactionServiceIgnoresUncommittedTransactionsDoesNotRollBack( KeyValueService keyValueService) { 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."); }, false); ReadOnlyTransactionSchemaManager readOnlyTransactionSchemaManager = new ReadOnlyTransactionSchemaManager(coordinationService); return new PreStartHandlingTransactionService( new SplitKeyDelegatingTransactionService<>( readOnlyTransactionSchemaManager::getTransactionsSchemaVersion, ImmutableMap.of(1, createV1TransactionService(keyValueService)))); } return createV1TransactionService(keyValueService); } }