2011-11-30 54 views

回答

11

假設您的客戶端已配置,並且您有一個表設置。做一個GET返回一個Result

Get get = new Get(Bytes.toBytes("row_key")); 
Result result_foo = table.get(get); 

結果是由KeyValue支持。 KeyValues包含時間戳。您可以使用list()獲取KeyValues列表,或者使用raw()獲取數組。 KeyValue有一個獲取時間戳方法。

result_foo.raw()[0].getTimestamp() 
0
result_foo.rawCells()(0).getTimestamp 

是一個良好的作風

+1

仍然需要大約索引,例如方括號'rawCells()[0]' –