本文整理汇总了Java中org.apache.hadoop.hbase.index.IndexSpecification.contains方法的典型用法代码示例。如果您正苦于以下问题:Java IndexSpecification.contains方法的具体用法?Java IndexSpecification.contains怎么用?Java IndexSpecification.contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.index.IndexSpecification
的用法示例。
在下文中一共展示了IndexSpecification.contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGetAndGroupByTS
import org.apache.hadoop.hbase.index.IndexSpecification; //导入方法依赖的package包/类
private static Multimap<Long, Cell> doGetAndGroupByTS(List<IndexSpecification> indexSpecs,
HRegion userRegion, Cell deleteKV, List<IndexSpecification> indicesToConsider)
throws IOException {
Get get = new Get(deleteKV.getRow());
long maxTS = HConstants.LATEST_TIMESTAMP;
if (deleteKV.getTimestamp() < maxTS) {
// Add +1 to make the current get includes the timestamp
maxTS = deleteKV.getTimestamp() + 1;
}
get.setTimeRange(0L, maxTS);
for (IndexSpecification index : indexSpecs) {
// Get all indices involves this family/qualifier
if (index.contains(deleteKV.getFamily(), deleteKV.getQualifier())) {
indicesToConsider.add(index);
for (ColumnQualifier cq : index.getIndexColumns()) {
get.addColumn(cq.getColumnFamily(), cq.getQualifier());
}
}
}
if (((KeyValue) deleteKV).isDeleteType()) {
get.setMaxVersions(1);
} else if (((KeyValue) deleteKV).isDeleteColumnOrFamily()) {
get.setMaxVersions();
}
List<KeyValue> userKVs = userRegion.get(get).list();
// Group KV based on timestamp
Multimap<Long, Cell> groupedKV = HashMultimap.create();
if (userKVs != null) {
for (Cell userKV : userKVs) {
groupedKV.put(userKV.getTimestamp(), userKV);
}
}
return groupedKV;
}