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

Use Long.MAX_VALUE instead of HConstants.FOREVER in CompactionPolicy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.0, 0.98.19, 1.4.0, 2.0.0
    • 1.3.0, 0.98.19, 2.0.0
    • Compaction
    • None

    Description

      The TTL per CF is in seconds, we will convert it to milliseconds when construct HStore. And if it is HConstants.FOREVER, we will set it to Long.MAX_VALUE.

      HStore.java
        public static long determineTTLFromFamily(final HColumnDescriptor family) {
          // HCD.getTimeToLive returns ttl in seconds.  Convert to milliseconds.
          long ttl = family.getTimeToLive();
          if (ttl == HConstants.FOREVER) {
            // Default is unlimited ttl.
            ttl = Long.MAX_VALUE;
          } else if (ttl == -1) {
            ttl = Long.MAX_VALUE;
          } else {
            // Second -> ms adjust for user data
            ttl *= 1000;
          }
          return ttl;
        }
      

      Attachments

        1. HBASE-15664.patch
          3 kB
          Duo Zhang
        2. HBASE-15664-0.98.patch
          3 kB
          Duo Zhang
        3. HBASE-15664-branch-1.patch
          3 kB
          Duo Zhang
        4. HBASE-15664-branch-1.v1.patch
          3 kB
          Duo Zhang
        5. HBASE-15664-v1.patch
          3 kB
          Duo Zhang
        6. HBASE-15664-v2.patch
          3 kB
          Duo Zhang

        Activity

          People

            zhangduo Duo Zhang
            zhangduo Duo Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: