Solr
  1. Solr
  2. SOLR-6586

JmxMonitoredMap#getAttribute is not very efficient.

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Issue Links

        Activity

        Hide
        Mark Miller added a comment - - edited

        When using JmxMonitoredMap in a pattern of:

        JmxMonitoredMap#getMBeanInfo // to get the attributes
        JmxMonitoredMap#getAttribute
        JmxMonitoredMap#getAttribute
        ...

        Each call of getAttribute calls getStatistics on the SolrInfoMBean.

        If there is any expense to the getStatistics call, this can be fairly painful. For example, the ReplicationHandler is registered so that it's getStatistics neeeds to be called twice if you go through all of the SolrInfoMBeans. However, because it's called for each attribute, it's actually called 2 * number of atrribs times. Because the replication handler does things like getting the size of the index directory, this is fairly wasteful.

        It seems one option around it is to implement getters for each attribute on the ReplicationHandler and other SolrInfoMBeans. That seems quite cumbersome and long term annoying though.

        Show
        Mark Miller added a comment - - edited When using JmxMonitoredMap in a pattern of: JmxMonitoredMap#getMBeanInfo // to get the attributes JmxMonitoredMap#getAttribute JmxMonitoredMap#getAttribute ... Each call of getAttribute calls getStatistics on the SolrInfoMBean. If there is any expense to the getStatistics call, this can be fairly painful. For example, the ReplicationHandler is registered so that it's getStatistics neeeds to be called twice if you go through all of the SolrInfoMBeans. However, because it's called for each attribute, it's actually called 2 * number of atrribs times. Because the replication handler does things like getting the size of the index directory, this is fairly wasteful. It seems one option around it is to implement getters for each attribute on the ReplicationHandler and other SolrInfoMBeans. That seems quite cumbersome and long term annoying though.
        Hide
        Mark Miller added a comment -

        In the short term, I don't see a clean way to deal with this due to a mismatch with the API's. To allow a workaround, I've filed SOLR-6747.

        Show
        Mark Miller added a comment - In the short term, I don't see a clean way to deal with this due to a mismatch with the API's. To allow a workaround, I've filed SOLR-6747 .
        Hide
        ASF subversion and git services added a comment -

        Commit 1640582 from Mark Miller in branch 'dev/trunk'
        [ https://svn.apache.org/r1640582 ]

        SOLR-6747: Add an optional caching option as a workaround for SOLR-6586.

        Show
        ASF subversion and git services added a comment - Commit 1640582 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1640582 ] SOLR-6747 : Add an optional caching option as a workaround for SOLR-6586 .
        Hide
        ASF subversion and git services added a comment -

        Commit 1640587 from Mark Miller in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1640587 ]

        SOLR-6747: Add an optional caching option as a workaround for SOLR-6586.

        Show
        ASF subversion and git services added a comment - Commit 1640587 from Mark Miller in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1640587 ] SOLR-6747 : Add an optional caching option as a workaround for SOLR-6586 .

          People

          • Assignee:
            Mark Miller
            Reporter:
            Mark Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:

              Development