B.Mr.W.
B.Mr.W.

Reputation: 19648

HBase REST API Search by row key

I am following this documentation trying to get the HBase REST API working. However, I have created a few dummy records through HBase shell as you can seen from the left side of the screenshot. And then I brought up the hbase daemon and tried to use postman plug-in to make a get request.

The good news is that it worked and gave me back a json but the bad news is the returned key 'cm93LTA=' doesn't make sense and so does the cell value 'Y2Y6Y3Ew'.

What is the proper way to make a get request?

Here is the format that I am trying to follow:

# given format
# I assume there is a typo here since they missed a slash between port and table name
http://example.com:8000<table>/<row>/<column>:<qualifier>/<timestamp>/content:raw
# my version
http://localhost:8080/test/row-0/cf:cq0

enter image description here

Upvotes: 1

Views: 1168

Answers (1)

halil
halil

Reputation: 1812

as you can see below, these are Base64 encoded values for row key and column key.

public static void main(String[] args) {
    System.out.println(Base64.base64Decode("cm93LTA="));
    System.out.println(Base64.base64Decode("Y2Y6Y3Ew"));
}

prints

row-0
cf:cq0

Upvotes: 1

Related Questions