从hbase行检索时间戳

Abh*_*hak 6 java hbase flume

使用Hbase API(Get/Put)或HBQL API,是否可以检索特定列的时间戳?

cod*_*Foo 12

假设您的客户端已配置并且您有一个表设置.执行get返回Result

Get get = new Get(Bytes.toBytes("row_key"));
Result result_foo = table.get(get);
Run Code Online (Sandbox Code Playgroud)

结果由KeyValue支持.KeyValues包含时间戳.您可以使用list()获取KeyValues列表,也可以使用raw()获取数组.KeyValue具有get timestamp方法.

result_foo.raw()[0].getTimestamp()
Run Code Online (Sandbox Code Playgroud)