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

Remove the TODO when increment zero

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0, 2.2.0, 2.1.2, 2.0.4
    • Component/s: None
    • Labels:
      None

      Description

       

      // If delta amount to apply is 0, don't write WAL or MemStore.
      long deltaAmount = getLongValue(delta);
      // TODO: Does zero value mean reset Cell? For example, the ttl.
      apply = deltaAmount != 0;
      

      This is an optimization when increment 0. But it introduced some new problems.

      1.As the TODO said, Does zero value mean reset ttl?

      2.HBASE-17318 have to introduce a new variable "firstWrite" because it don't apply 0.

      3. There is a coprocessor method postMutationBeforeWAL to return a new cell. But it may be not applied.

       

      // Give coprocessors a chance to update the new cell
      if (coprocessorHost != null) {
        newCell =
            coprocessorHost.postMutationBeforeWAL(mutationType, mutation, currentValue, newCell);
      }
      // If apply, we need to update memstore/WAL with new value; add it toApply.
      if (apply || firstWrite) {
        toApply.add(newCell);
      }
      

       

      So my proposal is remove this optimization. Any suggestions are welcomed.

       

       

       

       

       

        Attachments

        1. HBASE-21640.master.003.patch
          6 kB
          Guanghao Zhang
        2. HBASE-21640.master.002.patch
          5 kB
          Guanghao Zhang
        3. HBASE-21640.master.001.patch
          3 kB
          Guanghao Zhang

          Issue Links

            Activity

              People

              • Assignee:
                zghao Guanghao Zhang
                Reporter:
                zghao Guanghao Zhang
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: