Solr
  1. Solr
  2. SOLR-6747

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

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0, 6.0
    • Component/s: None
    • Labels:
      None
    1. SOLR-6747.patch
      10 kB
      Mark Miller

      Issue Links

        Activity

        Hide
        Gregory Chanan added a comment -
        NamedList cachedStats = this.cachedDynamicStats;
        NamedList stats;
         if (useCachedStatsBetweenGetMBeanInfoCalls && cachedStats != null) {
          stats = cachedStats;
        } else {
          stats = infoBean.getStatistics();
        }
        

        small optimization, but maybe better to avoid reading the volatile value if useCachedStatsBetweenGetMBeanInfoCalls is false?
        i.e.

        NamedList stats;
        if (useCachedStatsBetweenGetMBeanInfoCalls) {
          NamedList cachedStats = this.cachedDynamicStats;
          if (cachedStats != null) {
            stats = cachedStats;
          }
        }
        if (stats == null) {
          stats = infoBean.getStatistics();
        }
        

        could optimize further by eliminating the conditional when useCachedStatsBetweenGetMBeanInfoCalls is false but perhaps not worth it.

        Otherwise, looks good, +1.

        Show
        Gregory Chanan added a comment - NamedList cachedStats = this .cachedDynamicStats; NamedList stats; if (useCachedStatsBetweenGetMBeanInfoCalls && cachedStats != null ) { stats = cachedStats; } else { stats = infoBean.getStatistics(); } small optimization, but maybe better to avoid reading the volatile value if useCachedStatsBetweenGetMBeanInfoCalls is false? i.e. NamedList stats; if (useCachedStatsBetweenGetMBeanInfoCalls) { NamedList cachedStats = this .cachedDynamicStats; if (cachedStats != null ) { stats = cachedStats; } } if (stats == null ) { stats = infoBean.getStatistics(); } could optimize further by eliminating the conditional when useCachedStatsBetweenGetMBeanInfoCalls is false but perhaps not worth it. Otherwise, looks good, +1.
        Hide
        Mark Miller added a comment -

        small optimization, but maybe better to avoid reading the volatile value if useCachedStatsBetweenGetMBeanInfoCalls is false?

        +1

        Show
        Mark Miller added a comment - small optimization, but maybe better to avoid reading the volatile value if useCachedStatsBetweenGetMBeanInfoCalls is false? +1
        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 .
        Hide
        Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development