本文整理了Java中com.palantir.atlasdb.transaction.api.Transaction.setTransactionType()
方法的一些代码示例,展示了Transaction.setTransactionType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transaction.setTransactionType()
方法的具体详情如下:
包路径:com.palantir.atlasdb.transaction.api.Transaction
类名称:Transaction
方法名:setTransactionType
暂无
代码示例来源:origin: palantir/atlasdb
@Override
public void setTransactionType(TransactionType transactionType) {
delegate().setTransactionType(transactionType);
}
代码示例来源:origin: palantir/atlasdb
@Override
public void run(
TransactionManager txManager,
TableReference tableRef,
Set<Cell> cells,
TransactionType transactionType) {
Collection<OnCleanupTask> nextTasks = cleanupTasksByTable.get(tableRef);
while (!nextTasks.isEmpty()) {
final Collection<OnCleanupTask> cleanupTasks = nextTasks;
nextTasks = txManager.runTaskWithRetry(tx -> {
Collection<OnCleanupTask> toRetry = Lists.newArrayList();
Preconditions.checkArgument(transactionType == TransactionType.HARD_DELETE
|| transactionType == TransactionType.AGGRESSIVE_HARD_DELETE);
tx.setTransactionType(transactionType);
for (OnCleanupTask task : cleanupTasks) {
boolean needsRetry = task.cellsCleanedUp(tx, cells);
if (needsRetry) {
toRetry.add(task);
}
}
return toRetry;
});
}
}
}
代码示例来源:origin: palantir/atlasdb
private <T> T runWithRetry(Transaction.TransactionType type, Function<ProfileStore, T> task) {
return txnMgr.runTaskWithRetry(txn -> {
txn.setTransactionType(type);
ProfileStore store = new ProfileStore(txnMgr, txn);
return task.apply(store);
});
}
代码示例来源:origin: com.palantir.atlasdb/atlasdb-client
@Override
public void setTransactionType(TransactionType transactionType) {
delegate().setTransactionType(transactionType);
}
代码示例来源:origin: com.palantir.atlasdb/atlasdb-impl-shared
@Override
public void run(
TransactionManager txManager,
TableReference tableRef,
Set<Cell> cells,
TransactionType transactionType) {
Collection<OnCleanupTask> nextTasks = cleanupTasksByTable.get(tableRef);
while (!nextTasks.isEmpty()) {
final Collection<OnCleanupTask> cleanupTasks = nextTasks;
nextTasks = txManager.runTaskWithRetry(tx -> {
Collection<OnCleanupTask> toRetry = Lists.newArrayList();
Preconditions.checkArgument(transactionType == TransactionType.HARD_DELETE
|| transactionType == TransactionType.AGGRESSIVE_HARD_DELETE);
tx.setTransactionType(transactionType);
for (OnCleanupTask task : cleanupTasks) {
boolean needsRetry = task.cellsCleanedUp(tx, cells);
if (needsRetry) {
toRetry.add(task);
}
}
return toRetry;
});
}
}
}
内容来源于网络,如有侵权,请联系作者删除!