diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/rest/package.html hbase-server/src/main/java/org/apache/hadoop/hbase/rest/package.html index 2301a43..947616b 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/rest/package.html +++ hbase-server/src/main/java/org/apache/hadoop/hbase/rest/package.html @@ -52,6 +52,7 @@ This package provides a RESTful Web service front end for HBase.
+ GET /<table>/<optional_row_prefix>*?<scan_parameters> ++
+ The current scanner API expects clients to restart scans if there is a REST server failure in the midst. The stateless + does not store any state related to scan operation and all the parameters are specified as query parameters. +
+
+ The following are the scan parameters +
+
+ More on start row, end row and limit parameters. +
+
Examples
+
+
++ ++Lets say we have a table with name "ExampleScanner". On Hbase shell, +>> scan 'ExampleScanner' + +ROW COLUMN+CELL +testrow1 column=a:1, timestamp=1389900769772, value=testvalue-a1 +testrow1 column=b:1, timestamp=1389900780536, value=testvalue-b1 +testrow2 column=a:1, timestamp=1389900823877, value=testvalue-a2 +testrow2 column=b:1, timestamp=1389900818233, value=testvalue-b2 +testrow3 column=a:1, timestamp=1389900847336, value=testvalue-a3 +testrow3 column=b:1, timestamp=1389900856845, value=testvalue-b3 +++
+- +
++Scanning the entire table in json + +curl -H "Accept: application/json" https://localhost:8080/ExampleScanner/* +++ +{"Row":[{"key":"dGVzdHJvdzE=","Cell":[{"column":"YTox","timestamp":1389900769772,"$":"dGVzdHZhbHVlLWEx"},
+{"column":"Yjox","timestamp":1389900780536,"$":"dGVzdHZhbHVlLWIx"}]},{"key":"dGVzdHJvdzI=","Cell":[{"column":
+"YTox","timestamp":1389900823877,"$":"dGVzdHZhbHVlLWEy"}{"column":"Yjox",
+"timestamp":1389900818233,"$":"dGVzdHZhbHVlLWIy"}]},{"key":"dGVzdHJvdzM=","Cell":[{"column":"YTox",
+"timestamp":1389900847336,"$":"dGVzdHZhbHVlLWEz"},{"column":"Yjox","timestamp":1389900856845,"$":"dGVzdHZhbHVlLWIz"}]}]}
+
+ ++
- +
++Scanning the entire table in XML + +curl -H "Content-Type: text/xml" https://localhost:8080/ExampleScanner/* +++ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="dGVzdHJvdzE=">
+<Cell column="YTox" timestamp="1389900769772">dGVzdHZhbHVlLWEx</Cell><Cell column="Yjox"
+timestamp="1389900780536">dGVzdHZhbHVlLWIx</Cell></Row><Row key="dGVzdHJvdzI="><
+Cell column="YTox" timestamp="1389900823877">dGVzdHZhbHVlLWEy</Cell><Cell column="Yjox"
+timestamp="1389900818233">dGVzdHZhbHVlLWIy</Cell></Row><Row key="dGVzdHJvdzM="><
+Cell column="YTox" timestamp="1389900847336">dGVzdHZhbHVlLWEz</Cell><Cell column="Yjox"
+timestamp="1389900856845">dGVzdHZhbHVlLWIz</Cell></Row></CellSet>
+ ++
- +
++Scanning the entire table in binary + +curl -H "Accept: application/protobuf" https://localhost:8080/ExampleScanner/* + +^@Ì +B +^Htestrow1^R^Z^R^Ca:1^XìÓªä¹("^Ltestvalue-a1^R^Z^R^Cb:1^Xø§«ä¹("^Ltestvalue-b1 +B +^Htestrow2^R^Z^R^Ca:1^XÅúä¹("^Ltestvalue-a2^R^Z^R^Cb:1^X¹Îä¹("^Ltestvalue-b2 +B +^Htestrow3^R^Z^R^Ca:1^X豯ä¹("^Ltestvalue-a3^R^Z^R^Cb:1^X<8d>ü¯ä¹("^Ltestvalue-b3 ++- +
++Scanning the first row of table + +curl -H "Content-Type: text/xml" https://localhost:8080/ExampleScanner/*?limit=1 +++ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="dGVzdHJvdzE=">
+<Cell column="YTox" timestamp="1389900769772">dGVzdHZhbHVlLWEx</Cell><Cell column="Yjox"
+timestamp="1389900780536">dGVzdHZhbHVlLWIx</Cell></Row></CellSet>
+ ++
- +
++Scanning a given column of table + +curl -H "Content-Type: text/xml" https://localhost:8080/ExampleScanner/*?columns=a:1 +++ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="dGVzdHJvdzE=">
+<Cell column="YTox" timestamp="1389900769772">dGVzdHZhbHVlLWEx</Cell></Row><Row key="dGVzdHJvdzI="><
+Cell column="YTox" timestamp="1389900823877">dGVzdHZhbHVlLWEy</Cell></Row><Row key="dGVzdHJvdzM="><
+Cell column="YTox" timestamp="1389900847336">dGVzdHZhbHVlLWEz</Cell></Row></CellSet>
+ ++
- +
++Scanning more than one column of table + +curl -H "Content-Type: text/xml" https://localhost:8080/ExampleScanner/*?columns=a:1,b:1 +++ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="dGVzdHJvdzE="><
+Cell column="YTox" timestamp="1389900769772">dGVzdHZhbHVlLWEx</Cell><Cell column="Yjox"
+timestamp="1389900780536">dGVzdHZhbHVlLWIx</Cell></Row><Row key="dGVzdHJvdzI="><
+Cell column="YTox" timestamp="1389900823877">dGVzdHZhbHVlLWEy</Cell><Cell column="Yjox"
+timestamp="1389900818233">dGVzdHZhbHVlLWIy</Cell></Row><Row key="dGVzdHJvdzM="><
+Cell column="YTox" timestamp="1389900847336">dGVzdHZhbHVlLWEz</Cell><Cell column="Yjox"
+timestamp="1389900856845">dGVzdHZhbHVlLWIz</Cell></Row></CellSet>
+ ++
- +
++Scanning table with start row and limit + +curl -H "Content-Type: text/xml" https://localhost:8080/ExampleScanner/*?startrow=testrow1&limit=2 +++ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="dGVzdHJvdzE="><
+Cell column="YTox" timestamp="1389900769772">dGVzdHZhbHVlLWEx</Cell><Cell column="Yjox"
+timestamp="1389900780536">dGVzdHZhbHVlLWIx</Cell></Row><Row key="dGVzdHJvdzI="><
+Cell column="YTox" timestamp="1389900823877">dGVzdHZhbHVlLWEy</Cell><Cell column="Yjox"
+timestamp="1389900818233">dGVzdHZhbHVlLWIy</Cell></Row></CellSet>
+ ++
- +
++Scanning with start and end time + +curl -H "Content-Type: text/xml" https://localhost:8080/ExampleScanner/*?starttime=1389900769772&endtime=1389900800000 +++ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="dGVzdHJvdzE="><
+Cell column="YTox" timestamp="1389900769772">dGVzdHZhbHVlLWEx</Cell><Cell column="Yjox"
+timestamp="1389900780536">dGVzdHZhbHVlLWIx</Cell></Row></CellSet>
+ ++
- +
++Scanning with row prefix + +curl -H "Content-Type: text/xml" https://localhost:8080/ExampleScanner/test* +++ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="dGVzdHJvdzE=">
+<Cell column="YTox" timestamp="1389900769772">dGVzdHZhbHVlLWEx</Cell><Cell column="Yjox"
+timestamp="1389900780536">dGVzdHZhbHVlLWIx</Cell></Row><Row key="dGVzdHJvdzI="><
+Cell column="YTox" timestamp="1389900823877">dGVzdHZhbHVlLWEy</Cell><Cell column="Yjox"
+timestamp="1389900818233">dGVzdHZhbHVlLWIy</Cell></Row><Row key="dGVzdHJvdzM="><
+Cell column="YTox" timestamp="1389900847336">dGVzdHZhbHVlLWEz</Cell><Cell column="Yjox"
+timestamp="1389900856845">dGVzdHZhbHVlLWIz</Cell></Row></CellSet>
+ ++