use of com.palantir.atlasdb.internalschema.TransactionSchemaInstaller in project atlasdb by palantir.
the class TransactionManagers method getTransactionSchemaInstallerIfSupported.
private static Optional<TransactionSchemaInstaller> getTransactionSchemaInstallerIfSupported(@Output List<AutoCloseable> closeables, KeyValueService keyValueService, Supplier<AtlasDbRuntimeConfig> runtimeConfigSupplier, TransactionSchemaManager transactionSchemaManager) {
CheckAndSetCompatibility compatibility = keyValueService.getCheckAndSetCompatibility();
if (compatibility.supportsCheckAndSetOperations() && compatibility.supportsDetailOnFailure()) {
return Optional.of(initializeTransactionSchemaInstaller(closeables, runtimeConfigSupplier, transactionSchemaManager));
}
runtimeConfigSupplier.get().internalSchema().targetTransactionsSchemaVersion().filter(version -> version != TransactionConstants.DIRECT_ENCODING_TRANSACTIONS_SCHEMA_VERSION).ifPresent(version -> log.warn("This service seems like it has been configured to use transaction schema version {}," + " which isn't supported as your KVS doesn't support details on CAS failures" + " (typically Postgres or Oracle). We will remain with transactions1.", SafeArg.of("configuredTransactionSchemaVersion", version)));
return Optional.empty();
}
use of com.palantir.atlasdb.internalschema.TransactionSchemaInstaller in project atlasdb by palantir.
the class TransactionManagers method createTransactionComponents.
private TransactionComponents createTransactionComponents(@Output List<AutoCloseable> closeables, MetricsManager metricsManager, LockAndTimestampServices lockAndTimestampServices, KeyValueService keyValueService, Supplier<AtlasDbRuntimeConfig> runtimeConfigSupplier) {
CoordinationService<InternalSchemaMetadata> coordinationService = getSchemaMetadataCoordinationService(metricsManager, lockAndTimestampServices, keyValueService);
TransactionSchemaManager transactionSchemaManager = new TransactionSchemaManager(coordinationService);
TransactionService transactionService = initializeCloseable(() -> AtlasDbMetrics.instrumentTimed(metricsManager.getRegistry(), TransactionService.class, TransactionServices.createTransactionService(keyValueService, transactionSchemaManager, metricsManager.getTaggedRegistry(), () -> runtimeConfigSupplier.get().internalSchema().acceptStagingReadsOnVersionThree())), closeables);
Optional<TransactionSchemaInstaller> schemaInstaller = getTransactionSchemaInstallerIfSupported(closeables, keyValueService, runtimeConfigSupplier, transactionSchemaManager);
return ImmutableTransactionComponents.builder().transactionService(transactionService).schemaInstaller(schemaInstaller).build();
}
Aggregations