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

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

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

TransactionManager.finishRunTaskWithLockThrowOnConflict介绍

[英]Runs a provided task, commits the transaction, and performs cleanup associated with a transaction created by #setupRunTaskWithConditionThrowOnConflict(PreCommitCondition). If no further work needs to be done with the transaction, a no-op task can be passed in.
[中]运行提供的任务,提交事务,并执行与#setupRunTaskWithConditionThrowOnConflict(预提交条件)创建的事务关联的清理。如果不需要对事务执行进一步的工作,则可以传入一个无操作任务。

代码示例

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

@Override
public void commit(TransactionToken token) {
  TransactionAndImmutableTsLock txAndLock = transactions.getIfPresent(token);
  if (txAndLock != null) {
    txManager.finishRunTaskWithLockThrowOnConflict(txAndLock, (TxTask) transaction -> null);
    transactions.invalidate(token);
  }
}

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

@Override
public void abort(TransactionToken token) {
  TransactionAndImmutableTsLock txAndLock = transactions.getIfPresent(token);
  if (txAndLock != null) {
    txManager.finishRunTaskWithLockThrowOnConflict(txAndLock, (TxTask) transaction -> {
      transaction.abort();
      return null;
    });
    transactions.invalidate(token);
  }
}

代码示例来源:origin: com.palantir.atlasdb/atlasdb-service

@Override
public void commit(TransactionToken token) {
  TransactionAndImmutableTsLock txAndLock = transactions.getIfPresent(token);
  if (txAndLock != null) {
    txManager.finishRunTaskWithLockThrowOnConflict(txAndLock, (TxTask) transaction -> null);
    transactions.invalidate(token);
  }
}

代码示例来源:origin: com.palantir.atlasdb/atlasdb-service

@Override
public void abort(TransactionToken token) {
  TransactionAndImmutableTsLock txAndLock = transactions.getIfPresent(token);
  if (txAndLock != null) {
    txManager.finishRunTaskWithLockThrowOnConflict(txAndLock, (TxTask) transaction -> {
      transaction.abort();
      return null;
    });
    transactions.invalidate(token);
  }
}

相关文章