You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Toshihiro Suzuki (Jira)" <ji...@apache.org> on 2020/09/08 06:02:00 UTC
[jira] [Updated] (HBASE-24602) Add Increment and Append support to
CheckAndMutate
[ https://issues.apache.org/jira/browse/HBASE-24602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Toshihiro Suzuki updated HBASE-24602:
-------------------------------------
Release Note:
Summary of the change of HBASE-24602:
- Add build(Increment) and build(Append) methods to the Builder class of the CheckAndMutate class. After this change, we can perform checkAndIncrement/Append operation as follows:
```
// Build a CheckAndMutate object with a Increment object
CheckAndMutate checkAndMutate = CheckAndMutate.newBuilder(row)
.ifEquals(family, qualifier, value)
.build(increment);
// Perform a CheckAndIncrement operation
CheckAndMutateResult checkAndMutateResult = table.checkAndMutate(checkAndMutate);
// Get whether or not the CheckAndIncrement operation is successful
boolean success = checkAndMutateResult.isSuccess();
// Get the result of the increment operation
Result result = checkAndMutateResult.getResult();
```
- After this change, HRegion.batchMutate() is used for increment/append operations.
- As the side effect of the above change, the following coprocessor methods of RegionObserver are called when increment/append operations are performed:
- preBatchMutate()
- postBatchMutate()
- postBatchMutateIndispensably()
> Add Increment and Append support to CheckAndMutate
> --------------------------------------------------
>
> Key: HBASE-24602
> URL: https://issues.apache.org/jira/browse/HBASE-24602
> Project: HBase
> Issue Type: New Feature
> Reporter: Toshihiro Suzuki
> Assignee: Toshihiro Suzuki
> Priority: Major
> Fix For: 3.0.0-alpha-1, 2.4.0
>
>
> Currently, CheckAndMutate supports only Put and Delete. Supporting Increment and Append would be helpful for some use cases.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)