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

Tune HConnectionManager#getCachedLocation method

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.90.5
    • 0.94.0
    • None
    • Reviewed
    • tunning getCachedLocation method

    Description

      About 75% improvement in execution time.
      1. Add the following method in SoftValueSortedMap:

      public synchronized <K, V> Entry<K, V> lowerEntry(K key) {
        return ((TreeMap) this.internalMap).lowerEntry(key);
      }
      

      2. Modify getCachedLocation:

       
      Map.Entry<byte[], HRegionLocation> tEntry = tableLocations.lowerEntry(row);
        if (tEntry != null) {
        HRegionLocation possibleRegion = tEntry.getValue();
        //other code
      }
      

      Attachments

        1. 5388-v2.txt
          5 kB
          Ted Yu
        2. 5388-v3.txt
          4 kB
          Ted Yu
        3. 5388-v4.txt
          6 kB
          Lars Hofhansl
        4. 5388-v5.txt
          5 kB
          Ted Yu
        5. 5388-v6.txt
          6 kB
          Ted Yu
        6. HConnectionManager.java
          58 kB
          ronghai.ma
        7. SoftValueSortedMap.java
          6 kB
          ronghai.ma
        8. SoftValueSortedMap.java
          6 kB
          ronghai.ma

        Activity

          People

            ronghai.ma ronghai.ma
            ronghai.ma ronghai.ma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: