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

Default ArrayList size may not be optimal for Mutation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 2.0.0
    • None
    • Client, regionserver
    • None

    Description

        List<Cell> getCellList(byte[] family) {
          List<Cell> list = this.familyMap.get(family);
          if (list == null) {
            list = new ArrayList<Cell>();
          }
          return list;
        }
      

      Creates list of size 10, this is up to 80 bytes per column family in mutation object.

      Suggested:

        List<Cell> getCellList(byte[] family) {
          List<Cell> list = this.familyMap.get(family);
          if (list == null) {
            list = new ArrayList<Cell>(CELL_LIST_INITIAL_CAPACITY);
          }
          return list;
        }
      

      CELL_LIST_INITIAL_CAPACITY = 2 in the patch, this is debatable. For mutation where every CF has 1 cell, this gives decent reduction in memory allocation rate in both client and server during write workload. ~2%, not a big number, but as I said, already, memory optimization will include many small steps.

      Attachments

        1. HBASE-15493-v1.patch
          4 kB
          Vladimir Rodionov
        2. HBASE-15493-v2.patch
          6 kB
          Vladimir Rodionov

        Issue Links

          Activity

            People

              vrodionov Vladimir Rodionov
              vrodionov Vladimir Rodionov
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated: