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

Constructors that use Configuration may be harmful

    XMLWordPrintableJSON

Details

    • Umbrella
    • Status: Closed
    • Major
    • Resolution: Resolved
    • None
    • None
    • None
    • None

    Description

      There's a common pattern in HBase code where in the constructor, or in an initialization method also called once per instantiation, or both, we look up values from Hadoop Configuration and store them into fields. This can be expensive if the object is frequently created. Configuration is a heavyweight registry that does a lot of string operations and regex matching. See attached example. Method calls into Configuration account for 48.25% of CPU time when creating the HTable object in 0.98. (The remainder is spent instantiating the RPC controller via reflection, a separate issue that merits followup elsewhere.) Creation of HTable instances is expected to be a lightweight operation if a client is using unmanaged HConnections; however creating HTable instances takes up about 18% of the client's total on-CPU time. This is just one example where constructors that use Configuration may be harmful.

      Attachments

        1. traces.client.c.svg
          243 kB
          Andrew Kyle Purtell
        2. traces.client.getHTable.svg
          98 kB
          Andrew Kyle Purtell
        There are no Sub-Tasks for this issue.

        Activity

          People

            Unassigned Unassigned
            apurtell Andrew Kyle Purtell
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 120h
                120h
                Remaining:
                Time Spent - 72h Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - 72h Remaining Estimate - 48h
                72h