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

Atomic Check And Save in HTable

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.19.0
    • None
    • None

    Description

      Check And Save is a simple operation where one gives both a BatchUpdate with updates and a Map mapping columns to expected values (byte[] -> byte[]). The operation works as follows:

      1. Server gets locks on row.
      2. Server checks that the actual values of the specified columns match the given expected values
      3. If False, return False, if True update the row
      4. Unlock row.

      Pretty simple... but useful.

      Included in the attached patch are the necessary updates for HTable, HRegionServer, RegionServerInterface, and HRegion. I also added a small unit test to HTable where the test checks that checkAndSave succeeds when the expected values line up and fail when the values are different.

      Attachments

        1. hbase-1090v2.patch
          9 kB
          Michael Gottesman
        2. hbase-1090.patch
          9 kB
          Michael Gottesman
        3. 1090v5.patch
          11 kB
          Michael Gottesman
        4. 1090v4.patch
          9 kB
          Michael Stack
        5. 1090v3.patch
          10 kB
          Michael Stack

        Activity

          People

            gottesmm Michael Gottesman
            gottesmm Michael Gottesman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: