Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-215 Multiple Solr Cores - remove static singleton
  3. SOLR-409

Allow configurable class loader sharing between cores

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3
    • 1.3
    • None
    • None

    Description

      WHAT:
      This patch allows to configure in the multicore.xml the parent class loader of all core class loaders used to dynamically create instances.

      WHY:
      Current behavior allocates one class loader per config & thus per core.
      However, there are cases where one would like different cores to share some objects that are dynamically instantiated (ie, where the class name is used to find the class through the class loader and instantiate). In the current form; since each core possesses its own class loader, static members are indeed different objects. For instance, there is no way of implementing a singleton shared between 2 request handlers.

      Originally from http://www.nabble.com/Post-SOLR215-SOLR350-singleton-issue-tf4776980.html

      HOW:
      The sharedLib attribute is extracted from the XML (multicore.xml) configuration file and parsed in the MultiCore load method. The directory path is used to create an URL class loader that will become the parent class loader of all core class loaders; since class resolution if performed on a parent-first basis, this allows sharing instances between different cores.

      STATUS:
      operational in conjunction with solr-350

      Attachments

        1. solr-409.patch
          6 kB
          Henri Biestro
        2. solr-409.patch
          7 kB
          Henri Biestro
        3. solr-350_409.patch
          42 kB
          Henri Biestro
        4. solr-350_409.patch
          43 kB
          Henri Biestro
        5. solr-350_409.patch
          61 kB
          Henri Biestro
        6. solr-350_409.patch
          62 kB
          Henri Biestro
        7. solr-350_409.patch
          106 kB
          Ryan McKinley
        8. solr-350_409.patch
          96 kB
          Henri Biestro
        9. solr-350_409_414.patch
          120 kB
          Henri Biestro

        Activity

          People

            ryantxu Ryan McKinley
            henrib Henri Biestro
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: