Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
rename TransactionKeyValueService to DataKeyValueService (#7307)
Browse files Browse the repository at this point in the history
rename TransactionKeyValueService to DataKeyValueService
  • Loading branch information
rhuffy authored Oct 7, 2024
1 parent 7778292 commit 420162f
Show file tree
Hide file tree
Showing 48 changed files with 435 additions and 332 deletions.
124 changes: 124 additions & 0 deletions .palantir/revapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,130 @@ acceptedBreaks:
\ ===java.util.Map<com.palantir.atlasdb.keyvalue.api.Cell, byte[]>===)"
justification: "KeyValueSnapshotReader is a relatively new API and is not widely\
\ used"
"0.1157.0":
com.palantir.atlasdb:atlasdb-api:
- code: "java.class.removed"
old: "interface com.palantir.atlasdb.cell.api.AutoDelegate_TransactionKeyValueService"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.class.removed"
old: "interface com.palantir.atlasdb.cell.api.AutoDelegate_TransactionKeyValueServiceManager"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.class.removed"
old: "interface com.palantir.atlasdb.cell.api.TransactionKeyValueService"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.class.removed"
old: "interface com.palantir.atlasdb.cell.api.TransactionKeyValueServiceManager"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.class.removed"
old: "interface com.palantir.atlasdb.spi.TransactionKeyValueServiceConfig"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.class.removed"
old: "interface com.palantir.atlasdb.spi.TransactionKeyValueServiceManagerFactory<T\
\ extends java.lang.Object>"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.class.removed"
old: "interface com.palantir.atlasdb.spi.TransactionKeyValueServiceRuntimeConfig"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.parameterTypeChanged"
old: "parameter com.palantir.atlasdb.transaction.api.snapshot.KeyValueSnapshotReaderManager\
\ com.palantir.atlasdb.transaction.api.snapshot.KeyValueSnapshotReaderManagerFactory::createKeyValueSnapshotReaderManager(===com.palantir.atlasdb.cell.api.TransactionKeyValueServiceManager===,\
\ com.palantir.atlasdb.transaction.service.TransactionService, boolean, com.palantir.atlasdb.transaction.api.OrphanedSentinelDeleter,\
\ com.palantir.atlasdb.transaction.api.DeleteExecutor, com.palantir.atlasdb.util.MetricsManager)"
new: "parameter com.palantir.atlasdb.transaction.api.snapshot.KeyValueSnapshotReaderManager\
\ com.palantir.atlasdb.transaction.api.snapshot.KeyValueSnapshotReaderManagerFactory::createKeyValueSnapshotReaderManager(===com.palantir.atlasdb.cell.api.DataKeyValueServiceManager===,\
\ com.palantir.atlasdb.transaction.service.TransactionService, boolean, com.palantir.atlasdb.transaction.api.OrphanedSentinelDeleter,\
\ com.palantir.atlasdb.transaction.api.DeleteExecutor, com.palantir.atlasdb.util.MetricsManager)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
com.palantir.atlasdb:atlasdb-config:
- code: "java.method.parameterTypeChanged"
old: "parameter com.palantir.atlasdb.factory.TransactionManagersInitializer\
\ com.palantir.atlasdb.factory.TransactionManagersInitializer::createInitialTables(com.palantir.atlasdb.keyvalue.api.KeyValueService,\
\ ===com.palantir.atlasdb.cell.api.TransactionKeyValueServiceManager===, java.util.Set<com.palantir.atlasdb.table.description.Schema>,\
\ boolean, boolean)"
new: "parameter com.palantir.atlasdb.factory.TransactionManagersInitializer\
\ com.palantir.atlasdb.factory.TransactionManagersInitializer::createInitialTables(com.palantir.atlasdb.keyvalue.api.KeyValueService,\
\ ===com.palantir.atlasdb.cell.api.DataKeyValueServiceManager===, java.util.Set<com.palantir.atlasdb.table.description.Schema>,\
\ boolean, boolean)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.parameterTypeChanged"
old: "parameter com.palantir.atlasdb.transaction.api.snapshot.KeyValueSnapshotReaderManagerFactory\
\ com.palantir.atlasdb.factory.AtlasDbServiceDiscovery::createKeyValueSnapshotReaderManagerFactoryOfCorrectType(===com.palantir.atlasdb.spi.TransactionKeyValueServiceConfig===)"
new: "parameter com.palantir.atlasdb.transaction.api.snapshot.KeyValueSnapshotReaderManagerFactory\
\ com.palantir.atlasdb.factory.AtlasDbServiceDiscovery::createKeyValueSnapshotReaderManagerFactoryOfCorrectType(===com.palantir.atlasdb.spi.DataKeyValueServiceConfig===)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method com.palantir.atlasdb.config.ImmutableAtlasDbConfig com.palantir.atlasdb.config.ImmutableAtlasDbConfig::withTransactionKeyValueService(com.palantir.atlasdb.spi.TransactionKeyValueServiceConfig)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method com.palantir.atlasdb.config.ImmutableAtlasDbConfig com.palantir.atlasdb.config.ImmutableAtlasDbConfig::withTransactionKeyValueService(java.util.Optional<?\
\ extends com.palantir.atlasdb.spi.TransactionKeyValueServiceConfig>)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method com.palantir.atlasdb.config.ImmutableAtlasDbConfig.Builder com.palantir.atlasdb.config.ImmutableAtlasDbConfig.Builder::transactionKeyValueService(com.palantir.atlasdb.spi.TransactionKeyValueServiceConfig)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method com.palantir.atlasdb.config.ImmutableAtlasDbConfig.Builder com.palantir.atlasdb.config.ImmutableAtlasDbConfig.Builder::transactionKeyValueService(java.util.Optional<?\
\ extends com.palantir.atlasdb.spi.TransactionKeyValueServiceConfig>)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig::withTransactionKeyValueService(com.palantir.atlasdb.spi.TransactionKeyValueServiceRuntimeConfig)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig::withTransactionKeyValueService(java.util.Optional<?\
\ extends com.palantir.atlasdb.spi.TransactionKeyValueServiceRuntimeConfig>)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig.Builder\
\ com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig.Builder::transactionKeyValueService(com.palantir.atlasdb.spi.TransactionKeyValueServiceRuntimeConfig)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig.Builder\
\ com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig.Builder::transactionKeyValueService(java.util.Optional<?\
\ extends com.palantir.atlasdb.spi.TransactionKeyValueServiceRuntimeConfig>)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method com.palantir.atlasdb.spi.TransactionKeyValueServiceManagerFactory<?>\
\ com.palantir.atlasdb.factory.AtlasDbServiceDiscovery::createTransactionKeyValueServiceManagerFactoryOfCorrectType(com.palantir.atlasdb.spi.TransactionKeyValueServiceConfig)"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method java.util.Optional<com.palantir.atlasdb.spi.TransactionKeyValueServiceConfig>\
\ com.palantir.atlasdb.config.AtlasDbConfig::transactionKeyValueService()"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method java.util.Optional<com.palantir.atlasdb.spi.TransactionKeyValueServiceConfig>\
\ com.palantir.atlasdb.config.ImmutableAtlasDbConfig::transactionKeyValueService()"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method java.util.Optional<com.palantir.atlasdb.spi.TransactionKeyValueServiceRuntimeConfig>\
\ com.palantir.atlasdb.config.AtlasDbRuntimeConfig::transactionKeyValueService()"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
- code: "java.method.removed"
old: "method java.util.Optional<com.palantir.atlasdb.spi.TransactionKeyValueServiceRuntimeConfig>\
\ com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig::transactionKeyValueService()"
justification: "Renaming TransactionKeyValueService to DataKeyValueService is\
\ acceptable as it is marked @Beta and unused in production."
"0.770.0":
com.palantir.atlasdb:atlasdb-api:
- code: "java.class.removed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* to transactions.
*/
@AutoDelegate
public interface TransactionKeyValueService {
public interface DataKeyValueService {
Map<RangeRequest, TokenBackedBasicResultsPage<RowResult<Value>, byte[]>> getFirstBatchForRanges(
TableReference tableRef, Iterable<RangeRequest> rangeRequests, long timestamp);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import java.util.function.LongSupplier;

@AutoDelegate
public interface TransactionKeyValueServiceManager extends AutoCloseable {
TransactionKeyValueService getTransactionKeyValueService(LongSupplier timestampSupplier);
public interface DataKeyValueServiceManager extends AutoCloseable {
DataKeyValueService getDataKeyValueService(LongSupplier timestampSupplier);

Optional<KeyValueService> getKeyValueService();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = As.PROPERTY, property = "type", visible = false)
public interface TransactionKeyValueServiceConfig {
public interface DataKeyValueServiceConfig {
String type();
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

package com.palantir.atlasdb.spi;

import com.palantir.atlasdb.cell.api.TransactionKeyValueServiceManager;
import com.palantir.atlasdb.cell.api.DataKeyValueServiceManager;
import com.palantir.atlasdb.coordination.CoordinationService;
import com.palantir.atlasdb.util.MetricsManager;
import com.palantir.dialogue.clients.DialogueClients;
import com.palantir.refreshable.Refreshable;

/**
* Factory for creating {@link TransactionKeyValueServiceManager} instances.
* Factory for creating {@link DataKeyValueServiceManager} instances.
*
* Implementations have access to the coordination service to be able query their internal state at a particular
* timestamp, as well as schedule changes to it at a future timestamp.
Expand All @@ -33,19 +33,19 @@
*
* @param <T> type used for the coordination state. Should be a jackson-compatible POJO.
*/
public interface TransactionKeyValueServiceManagerFactory<T> {
public interface DataKeyValueServiceManagerFactory<T> {

String getType();

Class<T> coordinationValueClass();

TransactionKeyValueServiceManager create(
DataKeyValueServiceManager create(
String namespace,
DialogueClients.ReloadingFactory reloadingFactory,
MetricsManager metricsManager,
CoordinationService<T> coordinationService,
KeyValueServiceManager keyValueServiceManager,
TransactionKeyValueServiceConfig install,
Refreshable<TransactionKeyValueServiceRuntimeConfig> runtime,
DataKeyValueServiceConfig install,
Refreshable<DataKeyValueServiceRuntimeConfig> runtime,
boolean initializeAsync);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
import com.fasterxml.jackson.annotation.JsonTypeInfo;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = false)
public interface TransactionKeyValueServiceRuntimeConfig {
public interface DataKeyValueServiceRuntimeConfig {
String type();
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.palantir.atlasdb.transaction.api.snapshot;

import com.palantir.atlasdb.cell.api.TransactionKeyValueServiceManager;
import com.palantir.atlasdb.cell.api.DataKeyValueServiceManager;
import com.palantir.atlasdb.transaction.api.DeleteExecutor;
import com.palantir.atlasdb.transaction.api.OrphanedSentinelDeleter;
import com.palantir.atlasdb.transaction.service.TransactionService;
Expand All @@ -26,7 +26,7 @@ public interface KeyValueSnapshotReaderManagerFactory {
String getType();

KeyValueSnapshotReaderManager createKeyValueSnapshotReaderManager(
TransactionKeyValueServiceManager transactionKeyValueServiceManager,
DataKeyValueServiceManager dataKeyValueServiceManager,
TransactionService transactionService,
boolean allowHiddenTableAccess,
OrphanedSentinelDeleter orphanedSentinelDeleter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import com.palantir.atlasdb.keyvalue.api.Cell;
import com.palantir.atlasdb.keyvalue.api.KeyValueService;
import com.palantir.atlasdb.keyvalue.api.TableReference;
import com.palantir.atlasdb.keyvalue.impl.DelegatingTransactionKeyValueServiceManager;
import com.palantir.atlasdb.keyvalue.impl.DelegatingDataKeyValueServiceManager;
import com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService;
import com.palantir.atlasdb.keyvalue.impl.TableSplittingKeyValueService;
import com.palantir.atlasdb.schema.KeyValueServiceMigrator;
Expand Down Expand Up @@ -362,7 +362,7 @@ private static AtlasDbServices createMock(KeyValueService kvs, InMemoryTimelockE
TargetedSweeper sweeper = TargetedSweeper.createUninitializedForTest(kvs, () -> 1);
SerializableTransactionManager txManager = SerializableTransactionManager.createForTest(
metricsManager,
new DelegatingTransactionKeyValueServiceManager(kvs),
new DelegatingDataKeyValueServiceManager(kvs),
timeLock.getLegacyTimelockService(),
timestampService,
timeLock.getLockService(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private AtlasDbConstants() {

public static final byte[] DEFAULT_METADATA_COORDINATION_KEY = PtBytes.toBytes("m");

public static final byte[] DEFAULT_TRANSACTION_KEY_VALUE_SERVICE_COORDINATION_KEY = PtBytes.toBytes("x");
public static final byte[] DEFAULT_DATA_KEY_VALUE_SERVICE_COORDINATION_KEY = PtBytes.toBytes("x");

public static final long DEFAULT_TRANSACTION_LOCK_ACQUIRE_TIMEOUT_MS = 60_000;
public static final int THRESHOLD_FOR_LOGGING_LARGE_NUMBER_OF_TRANSACTION_LOOKUPS = 10_000_000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import com.google.common.util.concurrent.ListenableFuture;
import com.google.errorprone.annotations.MustBeClosed;
import com.palantir.atlasdb.cell.api.TransactionKeyValueService;
import com.palantir.atlasdb.cell.api.DataKeyValueService;
import com.palantir.atlasdb.keyvalue.api.BatchColumnRangeSelection;
import com.palantir.atlasdb.keyvalue.api.Cell;
import com.palantir.atlasdb.keyvalue.api.ColumnRangeSelection;
Expand All @@ -34,11 +34,11 @@
import com.palantir.util.paging.TokenBackedBasicResultsPage;
import java.util.Map;

public final class DelegatingTransactionKeyValueService implements TransactionKeyValueService {
public final class DelegatingDataKeyValueService implements DataKeyValueService {

private final KeyValueService delegate;

public DelegatingTransactionKeyValueService(KeyValueService delegate) {
public DelegatingDataKeyValueService(KeyValueService delegate) {
this.delegate = delegate;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@

package com.palantir.atlasdb.keyvalue.impl;

import com.palantir.atlasdb.cell.api.DataKeyValueService;
import com.palantir.atlasdb.cell.api.DataKeyValueServiceManager;
import com.palantir.atlasdb.cell.api.DdlManager;
import com.palantir.atlasdb.cell.api.TransactionKeyValueService;
import com.palantir.atlasdb.cell.api.TransactionKeyValueServiceManager;
import com.palantir.atlasdb.keyvalue.api.KeyValueService;
import java.util.Optional;
import java.util.function.LongSupplier;

public final class DelegatingTransactionKeyValueServiceManager implements TransactionKeyValueServiceManager {
public final class DelegatingDataKeyValueServiceManager implements DataKeyValueServiceManager {

private final Optional<KeyValueService> delegate;
private final TransactionKeyValueService transactionKeyValueService;
private final DataKeyValueService dataKeyValueService;
private final DdlManager ddlManager;

public DelegatingTransactionKeyValueServiceManager(KeyValueService delegate) {
public DelegatingDataKeyValueServiceManager(KeyValueService delegate) {
this.delegate = Optional.of(delegate);
this.transactionKeyValueService = new DelegatingTransactionKeyValueService(delegate);
this.dataKeyValueService = new DelegatingDataKeyValueService(delegate);
this.ddlManager = new DelegatingDdlManager(delegate);
}

@Override
public TransactionKeyValueService getTransactionKeyValueService(LongSupplier _timestampSupplier) {
return transactionKeyValueService;
public DataKeyValueService getDataKeyValueService(LongSupplier _timestampSupplier) {
return dataKeyValueService;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import com.palantir.atlasdb.internalschema.InternalSchemaInstallConfig;
import com.palantir.atlasdb.keyvalue.api.LockWatchCachingConfig;
import com.palantir.atlasdb.memory.InMemoryAtlasDbConfig;
import com.palantir.atlasdb.spi.DataKeyValueServiceConfig;
import com.palantir.atlasdb.spi.KeyValueServiceConfig;
import com.palantir.atlasdb.spi.TransactionKeyValueServiceConfig;
import com.palantir.atlasdb.sweep.queue.config.TargetedSweepInstallConfig;
import com.palantir.exception.NotInitializedException;
import com.palantir.logsafe.DoNotLog;
Expand All @@ -51,7 +51,7 @@ public abstract class AtlasDbConfig {
public abstract KeyValueServiceConfig keyValueService();

@Beta
public abstract Optional<TransactionKeyValueServiceConfig> transactionKeyValueService();
public abstract Optional<DataKeyValueServiceConfig> dataKeyValueService();

public abstract Optional<LeaderConfig> leader();

Expand Down
Loading

0 comments on commit 420162f

Please sign in to comment.