简体   繁体   中英

How to get an HBase row using just they key?

I have a question which my be very basic, but I am new to HBase. I want to get a row (eg. []byte ) using just the row key.

I am looking at the Get object, but the constructor expects the entire row: https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Get.html which says "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."

More specifically, I am trying to use the output from HRegionLocator.getStartEndKeys() to get the entire row.

You can just use org.apache.hadoop.hbase.Get for this. Although the general Javadoc of the class and the constructor loosely speak of specifying the "row", it means "row key". You can find the specifics in the description of the constructor parameter row :

Parameters:

row - row key

So the parameter specific the key of the row, not the entire data of the row. With the other arguments to Get , you can be more specific about the columns that you want to retrieve from the row.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM