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

Put.setTimeStamp misleading (doesn't change timestamp on existing KeyValues, not copied in copy constructor)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.20.0, 0.20.1
    • 0.90.0
    • Client
    • None
    • Reviewed

    Description

      In the process of migrating some code from 0.19, and was changing BatchUpdate's to Put's. I was hit by a bit of a gotcha. In the old code, I populated the BatchUpdate, then set the timestamp. However, this doesn't wotk for Put, because Put creates KeyValue's with the currently set timestamp when adding values. Setting the timestamp at the end has no effect. Also, the copy constructor doesn't copy the timestamp (or writeToWAL) setting.

      One option would be to simply update the javadoc to make it clear that the timestamp needs to be set prior to adding values. I'm attaching a proposed patch which moves the timestamp setting to constructor only so that it isn't possible to trigger the confusing case at all.

      Attachments

        1. 1930-trunk.patch
          7 kB
          Dave Latham

        Issue Links

          Activity

            People

              Unassigned Unassigned
              davelatham Dave Latham
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: