org.apache.tephra.Transaction.getType()方法的使用及代码示例

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

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

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()));
}

相关文章