如何仅使用它们的键来获取 HBase 行?
How to get an HBase row using just they key?
我有一个非常基础的问题,但我是 HBase 的新手。我想只使用行键来获取一行(例如 []byte
)。
我正在查看 Get
对象,但构造函数需要整行:https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Get.html 表示 "To get everything for a row, instantiate a Get object with the row to get. To further narrow the scope of what to Get, use the methods below."
更具体地说,我正在尝试使用 HRegionLocator.getStartEndKeys() 的输出来获取整行。
您只需使用 org.apache.hadoop.hbase.Get
即可。尽管 class 的一般 Javadoc 和构造函数松散地谈到指定 "row",但它意味着 "row key"。您可以在 the description of the constructor parameter row
:
中找到具体信息
Parameters:
row - row key
所以参数特定于行的 key,而不是行的全部数据。
使用 Get
的其他参数,您可以更具体地指定要从行中检索的列。
我有一个非常基础的问题,但我是 HBase 的新手。我想只使用行键来获取一行(例如 []byte
)。
我正在查看 Get
对象,但构造函数需要整行:https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Get.html 表示 "To get everything for a row, instantiate a Get object with the row to get. To further narrow the scope of what to Get, use the methods below."
更具体地说,我正在尝试使用 HRegionLocator.getStartEndKeys() 的输出来获取整行。
您只需使用 org.apache.hadoop.hbase.Get
即可。尽管 class 的一般 Javadoc 和构造函数松散地谈到指定 "row",但它意味着 "row key"。您可以在 the description of the constructor parameter row
:
Parameters:
row - row key
所以参数特定于行的 key,而不是行的全部数据。
使用 Get
的其他参数,您可以更具体地指定要从行中检索的列。