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

TimeRange constructors should set allTime when appropriate

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.2.0, 1.1.3, 0.98.17
    • 1.4.0, 2.0.0
    • None
    • None
    • Reviewed

    Description

      The default TimeRange constructor creates a range from 0 to Long.MAX_VALUE and sets an allTime flag to true. This flag allows some performance optimizations when comparing or using TimeRanges.

      This flag is not set, however, if you call "new TimeRange(0L)" or "new TimeRange(0L, Long.MAX_VALUE)", even though both of these create a logically equivalent TimeRange to "new TimeRange()". Since TimeRanges are immutable and detecting this condition is trivial, we should set the flag automatically in the explicit constructors when appropriate.

      Attachments

        1. HBASE-14985.patch
          4 kB
          Geoffrey Jacoby
        2. HBASE-14985-v1.patch
          4 kB
          Geoffrey Jacoby
        3. HBASE-14985-v1.patch
          4 kB
          Ted Yu

        Activity

          People

            gjacoby Geoffrey Jacoby
            gjacoby Geoffrey Jacoby
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: