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

Replace HTableDescriptor#htd.getColumnFamilies().length with a low-cost implementation

    XMLWordPrintableJSON

Details

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

    Description

      Found quite a few places doing something like

          if (htd.getColumnFamilies().length == 0) {
      

      HTableDescriptor#htd.getColumnFamilies() does a few memory allocations. The purpose is to get the family number, it can be replaced with

      +  public int getColumnFamilyCount() {
       +    return families.size();
       +  }
      

      in HTableDescriptor which does not need these memory allocations.

      Attachments

        Activity

          People

            huaxiang Hua Xiang
            huaxiang Hua Xiang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: