Solr
  1. Solr
  2. SOLR-1178

Retrieve CoreContainer from EmbeddedSolrServer

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      Submitting the patch suggested by Paul Noble to deal with this issue:

      Hi all,

      I notice that when I use EmbeddedSolrServer I have to use Control C to stop the process. I think the way to shut it down is by calling

      coreContainer.shutdown().

      However, is it possible to get the coreContainer from a SolrServer object? Right now it is defined as protected final CoreContainer coreContainer;.

      I wanted to do:

      ((EmbeddedSolrServer)solr)getCoreContainer.shutdown();

      But is seem I need to keep my own reference to the coreContainer?

      Is changing this worth a patch?

      Eric

      1. embedded_solr_container.patch
        2 kB
        Eric Pugh
      2. SOLR-1178.patch
        4 kB
        Luca Cavanna
      3. SOLR-1178.patch
        0.5 kB
        Luca Cavanna

        Activity

        Eric Pugh created issue -
        Hide
        Eric Pugh added a comment -

        Patch file, and I added a really stupidly simple test. I added it to TestSolrProperties.java just cause it didn't seem worth creating another .java file, and I don't know if we need it.

        Show
        Eric Pugh added a comment - Patch file, and I added a really stupidly simple test. I added it to TestSolrProperties.java just cause it didn't seem worth creating another .java file, and I don't know if we need it.
        Eric Pugh made changes -
        Field Original Value New Value
        Attachment embedded_solr_container.patch [ 12408603 ]
        Hide
        Luca Cavanna added a comment -

        I just had the some problem with Solr 3.5. I think the patch is worthwhile. Maybe we could even add a shutdown method directly to the EmbeddedSolrServer?
        Any thoughts?

        Show
        Luca Cavanna added a comment - I just had the some problem with Solr 3.5. I think the patch is worthwhile. Maybe we could even add a shutdown method directly to the EmbeddedSolrServer? Any thoughts?
        Hide
        Luca Cavanna added a comment -

        I've had problems applying the original attached patch, so I added my own tiny patch, which adds a new shutdown method to EmbeddedSolrServer. Could you please let me know what do you think guys? Would you prefer the getCoreContainer() method, the shutdown() method, or nothing?

        Show
        Luca Cavanna added a comment - I've had problems applying the original attached patch, so I added my own tiny patch, which adds a new shutdown method to EmbeddedSolrServer. Could you please let me know what do you think guys? Would you prefer the getCoreContainer() method, the shutdown() method, or nothing?
        Luca Cavanna made changes -
        Attachment SOLR-1178.patch [ 12510716 ]
        Hide
        Simon Willnauer added a comment -

        Luca, I think we should provide getCoreContainer() as well and add the shutdown() sugar too. Can you add a small test and some javadoc?

        Show
        Simon Willnauer added a comment - Luca, I think we should provide getCoreContainer() as well and add the shutdown() sugar too. Can you add a small test and some javadoc?
        Hide
        Luca Cavanna added a comment -

        Thanks for your opinion Simon! I attached a new patch with both getCoreContainer() and shutdown() added to EmbeddedSolrServer and a new TestEmbeddedSolrServer class to test them.

        Show
        Luca Cavanna added a comment - Thanks for your opinion Simon! I attached a new patch with both getCoreContainer() and shutdown() added to EmbeddedSolrServer and a new TestEmbeddedSolrServer class to test them.
        Luca Cavanna made changes -
        Attachment SOLR-1178.patch [ 12510762 ]
        Hide
        Luca Cavanna added a comment -

        Is there something else I can do to have this patch moving forward?

        Show
        Luca Cavanna added a comment - Is there something else I can do to have this patch moving forward?
        Simon Willnauer made changes -
        Assignee Simon Willnauer [ simonw ]
        Hide
        Simon Willnauer added a comment -

        thanks luca, I take this...

        Show
        Simon Willnauer added a comment - thanks luca, I take this...
        Simon Willnauer made changes -
        Fix Version/s 3.6 [ 12319065 ]
        Fix Version/s 4.0 [ 12314992 ]
        Hide
        Simon Willnauer added a comment -

        thanks luca & eric

        Show
        Simon Willnauer added a comment - thanks luca & eric
        Simon Willnauer made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Luca Cavanna added a comment -

        Thanks Simon!

        Show
        Luca Cavanna added a comment - Thanks Simon!
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        991d 18h 56m 1 Simon Willnauer 06/Feb/12 12:05
        Resolved Resolved Closed Closed
        458d 22h 35m 1 Uwe Schindler 10/May/13 11:40

          People

          • Assignee:
            Simon Willnauer
            Reporter:
            Eric Pugh
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development