[英]Retrieving timestamp from hbase row
使用Hbase API(Get / Put)或HBQL API,是否可以檢索特定列的時間戳?
result_foo.rawCells()(0).getTimestamp
是一個很好的風格
我認為以下會更好:
KeyValue kv = result.getColumnLatest(family, qualifier);
String status = Bytes.toString(kv.getValue());
Long timestamp = kv.getTimestamp();
因為Result#getValue(family,qualifier)實現為
public byte[] getValue(byte[] family, byte[] qualifier) {
KeyValue kv = this.getColumnLatest(family, qualifier);
return kv == null ? null : kv.getValue();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.