本文整理了Java中org.apache.tephra.Transaction.getType()
方法的一些代码示例,展示了Transaction.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transaction.getType()
方法的具体详情如下:
包路径:org.apache.tephra.Transaction
类名称:Transaction
方法名:getType
暂无
代码示例来源:origin: stackoverflow.com
public void doStuff(List transactions) {
for (Transaction transaction : transactions) {
// use the correct implementation of transactionService based on the type
TransactionService transactionService = transactionServiceMap
.get(transaction.getType());
transactionService.process(transaction);
}
}
代码示例来源:origin: org.apache.tephra/tephra-core
public void abort(Transaction tx) {
// guard against changes to the transaction log while processing
txMetricsCollector.rate("abort");
Stopwatch timer = new Stopwatch().start();
this.logReadLock.lock();
try {
synchronized (this) {
ensureAvailable();
doAbort(tx.getTransactionId(), tx.getCheckpointWritePointers(), tx.getType());
}
appendToLog(TransactionEdit.createAborted(tx.getTransactionId(), tx.getType(), tx.getCheckpointWritePointers()));
txMetricsCollector.histogram("abort.latency", (int) timer.elapsedMillis());
} finally {
this.logReadLock.unlock();
}
}
代码示例来源:origin: org.apache.tephra/tephra-api
/**
* Creates a new transaction for a checkpoint operation, copying all members from the original transaction,
* with the updated checkpoint write pointers.
*
* @param toCopy the original transaction containing the state to copy
* @param writePointer the new write pointer to use for the transaction
* @param checkpointPointers the list of write pointers added from checkpoints on the transaction
*/
public Transaction(Transaction toCopy, long writePointer, long[] checkpointPointers) {
this(toCopy.getReadPointer(), toCopy.getTransactionId(), writePointer, toCopy.getInvalids(),
toCopy.getInProgress(), toCopy.getFirstShortInProgress(), toCopy.getType(), checkpointPointers,
toCopy.getVisibilityLevel());
}
代码示例来源:origin: org.apache.tephra/tephra-core
public static TTransaction wrap(Transaction tx) {
return new TTransaction(tx.getTransactionId(), tx.getReadPointer(),
Longs.asList(tx.getInvalids()), Longs.asList(tx.getInProgress()),
tx.getFirstShortInProgress(), getTTransactionType(tx.getType()),
tx.getWritePointer(), Longs.asList(tx.getCheckpointWritePointers()),
getTVisibilityLevel(tx.getVisibilityLevel()));
}
内容来源于网络,如有侵权,请联系作者删除!