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

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

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

Transaction.isExcluded介绍

[英]Returns true if the given version is present in one of the arrays of excluded versions (in-progress and invalid transactions).
[中]如果给定版本存在于排除版本(正在进行和无效事务)的数组中,则返回true。

代码示例

代码示例来源:origin: org.apache.tephra/tephra-api

/**
 * Returns whether or not the given version should be visible to the current transaction.  A version will be visible
 * if it was successfully committed prior to the current transaction starting, or was written by the current
 * transaction (using either the current write pointer or the write pointer from a prior checkpoint).
 *
 * @param version the data version to check for visibility
 * @return true if the version is visible, false if it should be hidden (filtered)
 *
 * @see #setVisibility(VisibilityLevel) to control whether the current write pointer is visible.
 */
public boolean isVisible(long version) {
 // either it was committed before or the change belongs to current tx
 return (version <= getReadPointer() && !isExcluded(version)) ||
   (isCurrentWrite(version) &&
     (visibilityLevel != VisibilityLevel.SNAPSHOT_EXCLUDE_CURRENT || writePointer != version));
}

代码示例来源:origin: co.cask.cdap/cdap-data-fabric

if (transaction.isExcluded(writePointer)) {
 continue;

相关文章