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

Add meaningful comment to HConstants.LATEST_TIMESTAMP to explain why it is MAX_VALUE

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.0
    • None
    • None
    • Reviewed

    Description

      Thanks to Jerry and Chia-Ping Tsai's comments to correct my wrong understanding.

      The following documentation says that by default(when the timestamp is not specified for Put or Delete), system uses the server's currentTimeMillis.
      1. In chapter 27.2.4 Put

      Doing a put always creates a new version of a cell, at a certain timestamp. By default the system uses the server’s currentTimeMillis, ...

      2. In chapter 27.2.5 Delete

      Deletes work by creating tombstone markers. For example, let’s suppose we want to delete a row. For this you can specify a version, or else by default the currentTimeMillis is used....

      It seems not consistent with the code. Because in the client side's code, when timestamp is not specified, HConstants.LATEST_TIMESTAMP is used, which is Long.MAX_VALUE, rather than System.currentTimeMillis().

      However, the documentation is correct, because on the server side, timestamp of Put cell with HConstants.LATEST_TIMESTAMP will be replaced with server's currentTimeMillis.

      So we decide to add more comments to HConstants.LATEST_TIMESTAMP to help the new comers steer clear of the confusion.

      Attachments

        1. HBASE-18824.master.000.patch
          1 kB
          Xiang Li
        2. HBASE-18824.master.001.patch
          1 kB
          Xiang Li
        3. HBASE-18824.master.002.patch
          2 kB
          Xiang Li
        4. HBASE-18824.master.003.patch
          2 kB
          Xiang Li
        5. HBASE-18824.master.004.patch
          2 kB
          Xiang Li
        6. HBASE-18824.master.005.patch
          2 kB
          Xiang Li

        Activity

          People

            xiangli Xiang Li
            xiangli Xiang Li
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: