Ignore:
Timestamp:
2015-02-03T21:55:54+13:00 (9 years ago)
Author:
ak19
Message:

Removing large chunks of commented out code ahead of changes. The commented out code was specific to Solr 3.3 but do not apply to Solr 4.7.2 that we use now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/SolrSearch.java

    r29355 r29710  
    8383        solr_cores.shutdown();
    8484        solr_cores = null;
    85 
    86         // For solr 3.3.0's jetty server, but not for solr 4.7.2's jetty server
    87         /*
    88         // 2. Remove all SolrCores in the CoreContainer (solr_cores) that are specific to this collection
    89         String collection_core_name_prefix = getCollectionCoreNamePrefix();
    90 
    91         Collection<String> coreNames = solr_cores.getCoreNames();
    92         if(!coreNames.isEmpty()) {
    93             Iterator<String> coreIterator = coreNames.iterator();
    94             while(coreIterator.hasNext()) {
    95 
    96             String solrCoreName = coreIterator.next();     
    97             if(solrCoreName.startsWith(collection_core_name_prefix)) {
    98 
    99                 logger.error("**** Removing collection-specific core: " + solrCoreName + " from CoreContainer");
    100 
    101                 // CoreContainer.remove(String name): removes and returns registered core w/o decrementing it's reference count
    102                 // http://lucene.apache.org/solr/api/index.html?org/apache/solr/core/CoreContainer.html
    103                 SolrCore solr_core = solr_cores.remove(solrCoreName);
    104                 while(!solr_core.isClosed()) {
    105                 logger.error("@@@@@@ " + solrCoreName + " was not closed. Closing....");
    106                 solr_core.close(); // http://lucene.apache.org/solr/api/org/apache/solr/core/SolrCore.html
    107                 }
    108                 if(solr_core.isClosed()) {
    109                 logger.error("@@@@@@ " + solrCoreName + " is closed.");
    110                 }
    111                 solr_core = null;
    112             }
    113             }
    114         }
    115 
    116         // 3. if there are no more solr cores in Greenstone, then solr_cores will be empty, null the CoreContainer
    117         // All going well, this will happen when we're ant stopping the Greenstone server and the last Solr collection
    118         // is being deactivated
    119         Collection<String> coreNamesRemaining = solr_cores.getCoreNames();
    120         if(coreNamesRemaining.isEmpty()) {
    121             logger.error("**** CoreContainer contains 0 solrCores. Shutting down...");
    122 
    123             solr_cores.shutdown(); // wouldn't do anything anyway for 0 cores I think
    124             solr_cores = null;
    125         }
    126         else { // else part is just for debugging
    127             Iterator coreIterator = coreNamesRemaining.iterator();
    128             while(coreIterator.hasNext()) {
    129             logger.error("**** Core: " + coreIterator.next() + " still exists in CoreContainer");
    130             }
    131         }
    132         */
    13385    }
    13486
Note: See TracChangeset for help on using the changeset viewer.