本文整理匯總了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;
}