本文整理了Java中com.palantir.atlasdb.transaction.api.TransactionManager.getKeyValueService()
方法的一些代码示例,展示了TransactionManager.getKeyValueService()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TransactionManager.getKeyValueService()
方法的具体详情如下:
包路径:com.palantir.atlasdb.transaction.api.TransactionManager
类名称:TransactionManager
方法名:getKeyValueService
[英]Returns the KVS used by this transaction manager. In general, this should not be used by clients, as direct reads and writes to the KVS will bypass the Atlas transaction protocol.
[中]返回此事务管理器使用的KVS。一般来说,客户端不应使用该协议,因为直接读取和写入KVS将绕过Atlas事务协议。
代码示例来源:origin: palantir/atlasdb
@Override
public void init(TransactionManager resource) {
try {
resource.getKeyValueService().dropTables(deprecatedTables);
log.info("Successfully dropped deprecated tables on startup.");
} catch (Throwable e) {
log.info("Could not drop deprecated tables from the underlying KeyValueService.", e);
}
}
代码示例来源:origin: palantir/atlasdb
public static Map<String, Object> execute(TransactionManager txnManager, int numClients,
int requestsPerClient) {
txnManager.getKeyValueService().createTable(TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA);
return new KvsWriteBenchmark(txnManager.getKeyValueService(), numClients, requestsPerClient).execute();
}
代码示例来源:origin: palantir/atlasdb
public static Map<String, Object> execute(TransactionManager txnManager, int numClients,
int requestsPerClient) {
return new KvsPutUnlessExistsBenchmark(txnManager.getKeyValueService(), numClients, requestsPerClient)
.execute();
}
代码示例来源:origin: palantir/atlasdb
public static Map<String, Object> execute(TransactionManager txnManager, int numClients,
int requestsPerClient) {
return new KvsReadBenchmark(txnManager.getKeyValueService(), numClients, requestsPerClient).execute();
}
代码示例来源:origin: palantir/atlasdb
public void initializeWithoutRunning(TransactionManager txManager) {
initializeWithoutRunning(SpecialTimestampsSupplier.create(txManager),
txManager.getTimelockService(),
txManager.getKeyValueService(),
TransactionServices.createTransactionService(txManager.getKeyValueService(),
CoordinationServices.createDefault(
txManager.getKeyValueService(),
txManager.getTimestampService(),
false)),
new TargetedSweepFollower(followers, txManager));
}
代码示例来源:origin: palantir/atlasdb
@Override
public boolean doTransactionAndReportOutcome() {
try {
return transactionManager.runTaskThrowOnConflict(tx -> {
KeyValueService kvs = transactionManager.getKeyValueService();
kvs.createTable(TEST_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA);
tx.put(TEST_TABLE, ImmutableMap.of(TEST_CELL, new byte[1]));
return true;
});
} catch (Exception e) {
return false;
}
}
代码示例来源:origin: palantir/atlasdb
private TargetedSweeper initializeAndGet(TargetedSweeper sweeper, TransactionManager txManager) {
sweeper.initializeWithoutRunning(
new SpecialTimestampsSupplier(txManager::getImmutableTimestamp, txManager::getImmutableTimestamp),
txManager.getTimelockService(),
txManager.getKeyValueService(),
TransactionServices.createForTesting(
txManager.getKeyValueService(), txManager.getTimestampService(), false),
new TargetedSweepFollower(ImmutableList.of(FOLLOWER), txManager));
sweeper.runInBackground();
return sweeper;
}
代码示例来源:origin: palantir/atlasdb
@Override
protected void cleanup() {
txnManager.getKeyValueService().truncateTable(tableFactory.getBlobsSerializableTable(null).getTableRef());
}
代码示例来源:origin: palantir/atlasdb
@Before
public void setUp() {
when(transactionManager.getKeyValueService()).thenReturn(keyValueService);
}
代码示例来源:origin: palantir/atlasdb
public static CoordinationResource create(TransactionManager transactionManager) {
return new SimpleCoordinationResource(transactionManager,
new TransactionSchemaManager(
CoordinationServices.createDefault(
transactionManager.getKeyValueService(),
transactionManager.getTimestampService(),
false)));
}
代码示例来源:origin: palantir/atlasdb
private boolean isInitializedInternal() {
// Note that the PersistentLockService is also initialized asynchronously as part of
// TransactionManagers.create; however, this is not required for the TransactionManager to fulfil
// requests (note that it is not accessible from any TransactionManager implementation), so we omit
// checking here whether it is initialized.
return txManager.getKeyValueService().isInitialized()
&& txManager.getTimelockService().isInitialized()
&& txManager.getTimestampService().isInitialized()
&& txManager.getCleaner().isInitialized()
&& initializationPrerequisite.get();
}
代码示例来源:origin: palantir/atlasdb
@Override
public long resetStateAndGetFreshTimestamp() {
forceInstallNewTransactionsSchemaVersion(1);
KeyValueService kvs = transactionManager.getKeyValueService();
kvs.truncateTable(AtlasDbConstants.COORDINATION_TABLE);
kvs.createTable(TEST_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA);
kvs.truncateTable(TEST_TABLE);
return timestampService.getFreshTimestamp();
}
代码示例来源:origin: palantir/atlasdb
private SweepTaskRunner getSweepTaskRunner(
TransactionManager transactionManager, MetricRegistry metricRegistry,
TaggedMetricRegistry taggedMetricRegistry) {
KeyValueService kvs = transactionManager.getKeyValueService();
LongSupplier ts = transactionManager.getTimestampService()::getFreshTimestamp;
TransactionService txnService
= TransactionServices.createForTesting(kvs, transactionManager.getTimestampService(), false);
SweepStrategyManager ssm = SweepStrategyManagers.completelyConservative(kvs); // maybe createDefault
PersistentLockManager noLocks = new PersistentLockManager(
MetricsManagers.of(metricRegistry, taggedMetricRegistry),
new NoOpPersistentLockService(),
AtlasDbConstants.DEFAULT_SWEEP_PERSISTENT_LOCK_WAIT_MILLIS);
CleanupFollower follower = CleanupFollower.create(ETE_SCHEMAS);
CellsSweeper cellsSweeper = new CellsSweeper(transactionManager, kvs, noLocks, ImmutableList.of(follower));
return new SweepTaskRunner(kvs, ts, ts, txnService, ssm, cellsSweeper);
}
代码示例来源:origin: com.palantir.atlasdb/atlasdb-config
@Override
public void init(TransactionManager resource) {
try {
resource.getKeyValueService().dropTables(deprecatedTables);
log.info("Successfully dropped deprecated tables on startup.");
} catch (Throwable e) {
log.info("Could not drop deprecated tables from the underlying KeyValueService.", e);
}
}
代码示例来源:origin: com.palantir.atlasdb/atlasdb-impl-shared
public void initializeWithoutRunning(TransactionManager txManager) {
initializeWithoutRunning(SpecialTimestampsSupplier.create(txManager),
txManager.getTimelockService(),
txManager.getKeyValueService(),
TransactionServices.createTransactionService(txManager.getKeyValueService(),
CoordinationServices.createDefault(
txManager.getKeyValueService(),
txManager.getTimestampService(),
false)),
new TargetedSweepFollower(followers, txManager));
}
代码示例来源:origin: com.palantir.atlasdb/atlasdb-impl-shared
private boolean isInitializedInternal() {
// Note that the PersistentLockService is also initialized asynchronously as part of
// TransactionManagers.create; however, this is not required for the TransactionManager to fulfil
// requests (note that it is not accessible from any TransactionManager implementation), so we omit
// checking here whether it is initialized.
return txManager.getKeyValueService().isInitialized()
&& txManager.getTimelockService().isInitialized()
&& txManager.getTimestampService().isInitialized()
&& txManager.getCleaner().isInitialized()
&& initializationPrerequisite.get();
}
内容来源于网络,如有侵权,请联系作者删除!