本文整理汇总了Java中org.apache.hadoop.hbase.CellComparator.compareTimestamps方法的典型用法代码示例。如果您正苦于以下问题:Java CellComparator.compareTimestamps方法的具体用法?Java CellComparator.compareTimestamps怎么用?Java CellComparator.compareTimestamps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.CellComparator
的用法示例。
在下文中一共展示了CellComparator.compareTimestamps方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compareCellKeysWithinRow
import org.apache.hadoop.hbase.CellComparator; //导入方法依赖的package包/类
/**
* Compare families, qualifiers, and timestamps of the given Cells.
* They are assumed to be of the same row.
* Nulls are after non-nulls.
*/
private static int compareCellKeysWithinRow(Cell c1, Cell c2) {
if (c1 == null) {
return 1; // source missing cell
}
if (c2 == null) {
return -1; // target missing cell
}
int result = CellComparator.compareFamilies(c1, c2);
if (result != 0) {
return result;
}
result = CellComparator.compareQualifiers(c1, c2);
if (result != 0) {
return result;
}
// note timestamp comparison is inverted - more recent cells first
return CellComparator.compareTimestamps(c1, c2);
}