com.palantir.atlasdb.transaction.api.TransactionManager.getTimestampService()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中com.palantir.atlasdb.transaction.api.TransactionManager.getTimestampService()方法的一些代码示例,展示了TransactionManager.getTimestampService()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TransactionManager.getTimestampService()方法的具体详情如下:
包路径:com.palantir.atlasdb.transaction.api.TransactionManager
类名称:TransactionManager
方法名:getTimestampService

TransactionManager.getTimestampService介绍

[英]Returns the timestamp service used by this transaction manager.
[中]返回此事务管理器使用的时间戳服务。

代码示例

代码示例来源:origin: palantir/atlasdb

private SimpleCoordinationResource(
    TransactionManager transactionManager,
    TransactionSchemaManager transactionSchemaManager) {
  this.transactionManager = transactionManager;
  this.transactionSchemaManager = transactionSchemaManager;
  this.timestampService = transactionManager.getTimestampService();
}

代码示例来源:origin: palantir/atlasdb

@Override
public long getFreshTimestamp() {
  // TODO(jlach): getFreshTimestamp
  return transactionManager.getTimestampService().getFreshTimestamp();
}

代码示例来源:origin: palantir/atlasdb

public static Map<String, Object> execute(TransactionManager txnManager, int numClients,
    int requestsPerClient) {
  return new TimestampBenchmark(txnManager.getTimestampService(), numClients, requestsPerClient).execute();
}

代码示例来源: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

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: 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

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

@Before
public void setup() {
  kvs = kvsManager.getDefaultKvs();
  ssm = SweepStrategyManagers.createDefault(kvs);
  txManager = getManager();
  txService = TransactionServices.createForTesting(kvs, txManager.getTimestampService(), false);
  SweepTestUtils.setupTables(kvs);
  persistentLockManager = new PersistentLockManager(
      MetricsManagers.createForTests(),
      SweepTestUtils.getPersistentLockService(kvs),
      AtlasDbConstants.DEFAULT_SWEEP_PERSISTENT_LOCK_WAIT_MILLIS);
}

代码示例来源: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();
}

代码示例来源: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-tests-shared

@Before
public void setup() {
  kvs = kvsManager.getDefaultKvs();
  ssm = SweepStrategyManagers.createDefault(kvs);
  txManager = getManager();
  txService = TransactionServices.createForTesting(kvs, txManager.getTimestampService(), false);
  SweepTestUtils.setupTables(kvs);
  persistentLockManager = new PersistentLockManager(
      MetricsManagers.createForTests(),
      SweepTestUtils.getPersistentLockService(kvs),
      AtlasDbConstants.DEFAULT_SWEEP_PERSISTENT_LOCK_WAIT_MILLIS);
}

相关文章