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

Effective MemStoreSize::hashCode()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.2
    • 2.2.0
    • None
    • None
    • Reviewed

    Description

      After HBASE-20411 we have

      MemStoreSize::hashCode()
        @Override
        public int hashCode() {
          long h = 31 * this.dataSize;
          h = h + 31 * this.heapSize;
          h = h + 31 * this.offHeapSize;
          return (int) h;
        }
       

      This is not effective hashCode() implementation. Instead we can use:

      MemStoreSize::hashCode()
        @Override
        public int hashCode() {
          long h = this.dataSize;
          h = h * 31 + this.heapSize;
          h = h * 31 + this.offHeapSize;
          return (int) h;
        }
       

      Attachments

        1. HBASE-20932.002.patch
          1 kB
          Mingliang Liu
        2. HBASE-20932.001.patch
          0.7 kB
          Mingliang Liu

        Issue Links

          Activity

            People

              liuml07 Mingliang Liu
              liuml07 Mingliang Liu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: