Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-11511

Use existing private field in DistributedUpdateProcessor

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 8.0
    • 7.2
    • SolrCloud
    • None

    Description

      The DistributedUpdateProcessor has a private instance field called cloudDesc. It is used in a few places, but most code navigates to CloudDescriptor from the request object instead.

      The fundamental question of this ticket, is this: is there any reason to distrust this field and do the navigation directly (in which case maybe we get rid of the field instead?) or can we trust it and thus should use it where we can. Since it is a private field only ever updated in the constructor, it's not likely to be changing out from under us. The request from which it is derived is also held in a private final field, so it very much looks to me like this field should have been final and should be used.

      This might or might not be a performance gain (depending on whether or not the compiler can optimize away something like this already), but it will be a readability and consistency gain for sure.

      Attaching patch to tidy this up shortly...

      Attachments

        1. SOLR-11511.patch
          9 kB
          Gus Heck

        Activity

          People

            dsmiley David Smiley
            gus Gus Heck
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: