[
https://issues.apache.org/jira/browse/HBASE-7129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16441085#comment-16441085
]
Dequan Chen edited comment on HBASE-7129 at 4/17/18 4:10 PM:
-------------------------------------------------------------
To [~mdrob] ,
To answer your today's question: In the check-and-put operation, new value
[first] and checked value (expected value) [second or last occurrence] are as
what you expressed - based on the order. In addition, between the two values,
there are cell name (column family:column name) to separate them.
In addition, I just submitted [^HBASE-7129.0005.patch] which contains all you
suggested Yesterday evening:
A. For the Detailed Explanation section of Check-And-Put, one more item is
added as follows:
{color:#f691b2}5. The {{"row key" in the request URL}} should be URL-encoded,
e.g., {{"david%20chen"}} and {{"row1"}} are the URL-encoded formats of row keys
{{"david chen"}} and {{"row1"}}, respectively {color}
B. A whole new Detailed Explanation section was added to the Check-And-Delete
as follows:
{color:#f691b2}Detailed Explanation:{color}
* {color:#f691b2}In the above 4 json-format examples:{color}
# {color:#f691b2}{{{"column":"Y2ZhOmFsaWFz", "$":"TmV3R3V5"}}} at the end of
{{-d}} option are {{the check cell name and check cell value in Base-64}}
respectively: {{"Y2ZhOmFsaWFz" for "cfa:alias"}}, and {{"TmV3R3V5" for
"NewGuy"}}{color}
# {color:#f691b2}{{"cm93MQ=="}} is {{the Base-64 for "row1"}} for the
checkAndPut {{row key}}{color}
# {color:#f691b2}{{"/?check=delete"}} at the end of {{the request URL}} is
required for checkAndDelete WebHBase operation to work{color}
# {color:#f691b2}{{"version_id"}} in the {{request URL}} of the last
json-format example should be equivalent to the value of {{"the timestamp
number + 1"}}{color}
# {color:#f691b2}The {{"row key"}}, {{"column family"}}, {{"cell name" or
"column family:column name"}}, and {{"version_id"}} in {{the request URL}} of a
checkAndDelete WebHBase operation should be URL-encoded, e.g., {{"row1"}},
{{"cfa"}}, {{"cfa:alias"}} and {{"1519423552160"}} in the examples are the
URL-encoded {{"row key"}}, {{"column family"}}, {{"column family:column
name"}}, and {{"version_id"}}, respectively{color}
* {color:#f691b2}Basically, the 4 xml-format examples are the same as the 4
corresponding json-format examples, and will not be explained here in
detail.{color}
As regards the row key, column, etc are in the request url, maybe a new Jira is
warranted to create for code improvement of the back-end HBase Rest
implementation because without them at present (our enterprise version is
v1.1.2) the Check-And-PUT or Check-And-Delete operation failed to work.
Hope that my above answer and additions are helpful.
Have a good day!
Dequan
was (Author: dequanchen):
Mike,
To answer your today's question: In the check-and-put operation, new value
[first] and checked value (expected value) [second or last occurrence] are as
what you expressed - based on the order. In addition, between the two values,
there are cell name (column family:column name) to separate them.
In addition, I just submitted [^HBASE-7129.0005.patch] which contains all you
suggested Yesterday evening:
A. For the Detailed Explanation section of Check-And-Put, one more item is
added as follows:
{color:#f691b2}5. The {{"row key" in the request URL}} should be URL-encoded,
e.g., {{"david%20chen"}} and {{"row1"}} are the URL-encoded formats of row keys
{{"david chen"}} and {{"row1"}}, respectively {color}
B. A whole new Detailed Explanation section was added to the Check-And-Delete
as follows:
{color:#f691b2}Detailed Explanation:{color}
* {color:#f691b2}In the above 4 json-format examples:{color}
# {color:#f691b2}{{{"column":"Y2ZhOmFsaWFz", "$":"TmV3R3V5"}}} at the end of
{{-d}} option are {{the check cell name and check cell value in Base-64}}
respectively: {{"Y2ZhOmFsaWFz" for "cfa:alias"}}, and {{"TmV3R3V5" for
"NewGuy"}}{color}
# {color:#f691b2}{{"cm93MQ=="}} is {{the Base-64 for "row1"}} for the
checkAndPut {{row key}}{color}
# {color:#f691b2}{{"/?check=delete"}} at the end of {{the request URL}} is
required for checkAndDelete WebHBase operation to work{color}
# {color:#f691b2}{{"version_id"}} in the {{request URL}} of the last
json-format example should be equivalent to the value of {{"the timestamp
number + 1"}}{color}
# {color:#f691b2}The {{"row key"}}, {{"column family"}}, {{"cell name" or
"column family:column name"}}, and {{"version_id"}} in {{the request URL}} of a
checkAndDelete WebHBase operation should be URL-encoded, e.g., {{"row1"}},
{{"cfa"}}, {{"cfa:alias"}} and {{"1519423552160"}} in the examples are the
URL-encoded {{"row key"}}, {{"column family"}}, {{"column family:column
name"}}, and {{"version_id"}}, respectively{color}
* {color:#f691b2}Basically, the 4 xml-format examples are the same as the 4
corresponding json-format examples, and will not be explained here in
detail.{color}
As regards the row key, column, etc are in the request url, maybe a new Jira is
warranted to create for code improvement of the back-end HBase Rest
implementation because without them at present (our enterprise version is
v1.1.2) the Check-And-PUT or Check-And-Delete operation failed to work.
Hope that my above answer and additions are helpful.
Have a good day!
Dequan
> Need documentation for REST atomic operations (HBASE-4720)
> ----------------------------------------------------------
>
> Key: HBASE-7129
> URL: https://issues.apache.org/jira/browse/HBASE-7129
> Project: HBase
> Issue Type: Improvement
> Components: documentation, REST
> Reporter: Joe Pallas
> Assignee: Dequan Chen
> Priority: Minor
> Labels: beginner
> Attachments: HBASE-7129.0001.patch, HBASE-7129.0002.patch,
> HBASE-7129.0003.patch, HBASE-7129.0004.patch, HBASE-7129.0005.patch,
> HBASE-7129.patch, image-2018-04-17-10-57-48-213.png
>
>
> HBASE-4720 added checkAndPut/checkAndDelete capability to the REST interface,
> but the REST documentation (in the package summary) needs to be updated so
> people know that this feature exists and how to use it.
> http://wiki.apache.org/hadoop/Hbase/Stargate
> http://hbase.apache.org/book/rest.html
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)