Solr
  1. Solr
  2. SOLR-7160

Decouple corecontainer configuration classes from solr.xml

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1
    • Component/s: None
    • Labels:
      None

      Description

      The ConfigSolr object that holds configuration options for CoreContainer is currently represented as a DOM object, with various methods on it for pulling values out of the DOM tree or out of System properties. This has a couple of drawbacks:
      1) it couples the configuration class directly to its representation on disk, which is a pain if we ever want to change it (say hello, old-style to new-style solr.xml upgrade!).
      2) the checking of system properties means that it's not threadsafe, which in turn means that all our cluster tests have to launch Jettys sequentially, rather than in parallel. This results in tests taking about 25 seconds to start up, before any of the test logic has been run.

      We should tidy this up.

      1. SOLR-7160.patch
        144 kB
        Alan Woodward

        Activity

        Hide
        Shalin Shekhar Mangar added a comment -

        +1

        I eventually want to be able to configure some of those things via the new config API but one step at a time.

        Show
        Shalin Shekhar Mangar added a comment - +1 I eventually want to be able to configure some of those things via the new config API but one step at a time.
        Hide
        Alan Woodward added a comment -

        Here's a patch, which does the following:

        • renames ConfigSolr to NodeConfig
        • makes NodeConfig an immutable POJO, constructed with a Builder
        • breaks the actual configuration up a bit, with CloudConfig, LoggingConfig and UpdateHandlerConfig classes for configuring the relevant bits of functionality.
        • The parsing of solr.xml is handled by a SolrXmlConfig class

        Once this is in, we can look at passing NodeConfig classes directly to JettySolrRunner objects, and spawning jetties in parallel.

        Show
        Alan Woodward added a comment - Here's a patch, which does the following: renames ConfigSolr to NodeConfig makes NodeConfig an immutable POJO, constructed with a Builder breaks the actual configuration up a bit, with CloudConfig, LoggingConfig and UpdateHandlerConfig classes for configuring the relevant bits of functionality. The parsing of solr.xml is handled by a SolrXmlConfig class Once this is in, we can look at passing NodeConfig classes directly to JettySolrRunner objects, and spawning jetties in parallel.
        Hide
        Shalin Shekhar Mangar added a comment -

        I like this a lot! Thanks for cleaning this up Alan.

        One trivial nit-pick is that NodeConfig doesn't seem like it'd ever be more than a solr.xml representation. Can we find a better name or maybe not rename it at all?

        Show
        Shalin Shekhar Mangar added a comment - I like this a lot! Thanks for cleaning this up Alan. One trivial nit-pick is that NodeConfig doesn't seem like it'd ever be more than a solr.xml representation. Can we find a better name or maybe not rename it at all?
        Hide
        Alan Woodward added a comment -

        Well I'd say it the other way round - solr.xml is just the representation of the NodeConfig And ConfigSolr is just too easily confused with SolrConfig, so I think the rename is worth it.

        Show
        Alan Woodward added a comment - Well I'd say it the other way round - solr.xml is just the representation of the NodeConfig And ConfigSolr is just too easily confused with SolrConfig, so I think the rename is worth it.
        Hide
        Shalin Shekhar Mangar added a comment -

        Okay, fire away then!

        Show
        Shalin Shekhar Mangar added a comment - Okay, fire away then!
        Hide
        ASF subversion and git services added a comment -

        Commit 1662232 from Alan Woodward in branch 'dev/trunk'
        [ https://svn.apache.org/r1662232 ]

        SOLR-7160: Decouple CoreContainer config from xml representation

        Show
        ASF subversion and git services added a comment - Commit 1662232 from Alan Woodward in branch 'dev/trunk' [ https://svn.apache.org/r1662232 ] SOLR-7160 : Decouple CoreContainer config from xml representation
        Hide
        ASF subversion and git services added a comment -

        Commit 1662235 from Alan Woodward in branch 'dev/trunk'
        [ https://svn.apache.org/r1662235 ]

        SOLR-7160: CHANGES.txt entry

        Show
        ASF subversion and git services added a comment - Commit 1662235 from Alan Woodward in branch 'dev/trunk' [ https://svn.apache.org/r1662235 ] SOLR-7160 : CHANGES.txt entry
        Hide
        ASF subversion and git services added a comment -

        Commit 1662238 from Alan Woodward in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1662238 ]

        SOLR-7160: Decouple CoreContainer config from xml representation

        Show
        ASF subversion and git services added a comment - Commit 1662238 from Alan Woodward in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1662238 ] SOLR-7160 : Decouple CoreContainer config from xml representation
        Hide
        Timothy Potter added a comment -

        Bulk close after 5.1 release

        Show
        Timothy Potter added a comment - Bulk close after 5.1 release

          People

          • Assignee:
            Alan Woodward
            Reporter:
            Alan Woodward
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development