Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-23146

Support CheckAndMutate with multiple conditions

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 2.3.0
    • None
    • None
    • Hide
      Add a checkAndMutate(row, filter) method in the AsyncTable interface and the Table interface.

      This method atomically checks if the row matches the specified filter. If it does, it adds the Put/Delete/RowMutations.

      This is a fluent style API, the code is like:

      For Table interface:
      {code}
      table.checkAndMutate(row, filter).thenPut(put);
      {code}

      For AsyncTable interface:
      {code}
      table.checkAndMutate(row, filter).thenPut(put)
          .thenAccept(succ -> {
            if (succ) {
              System.out.println("Check and put succeeded");
            } else {
              System.out.println("Check and put failed");
            }
          });
      {code}
      Show
      Add a checkAndMutate(row, filter) method in the AsyncTable interface and the Table interface. This method atomically checks if the row matches the specified filter. If it does, it adds the Put/Delete/RowMutations. This is a fluent style API, the code is like: For Table interface: {code} table.checkAndMutate(row, filter).thenPut(put); {code} For AsyncTable interface: {code} table.checkAndMutate(row, filter).thenPut(put)     .thenAccept(succ -> {       if (succ) {         System.out.println("Check and put succeeded");       } else {         System.out.println("Check and put failed");       }     }); {code}

    Description

      Currently, checkAndMutate supports only single condition. Supporting checkAndMutate with multi conditions is useful for some use cases.

      Attachments

        Issue Links

          Activity

            People

              brfrn169 Toshihiro Suzuki
              brfrn169 Toshihiro Suzuki
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: