mirror of https://github.com/apache/lucene.git
SOLR-3532 add shutdown to SolrServer
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1349127 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
25a59d8902
commit
40c18680ab
|
@ -252,6 +252,7 @@ public class EmbeddedSolrServer extends SolrServer
|
|||
/**
|
||||
* Shutdown all cores within the EmbeddedSolrServer instance
|
||||
*/
|
||||
@Override
|
||||
public void shutdown() {
|
||||
coreContainer.shutdown();
|
||||
}
|
||||
|
|
|
@ -752,7 +752,7 @@ public class BasicDistributedZkTest extends AbstractDistributedZkTestCase {
|
|||
public void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
if (solrj != null) {
|
||||
solrj.close();
|
||||
solrj.shutdown();
|
||||
}
|
||||
System.clearProperty("zkHost");
|
||||
}
|
||||
|
|
|
@ -1320,7 +1320,7 @@ public class FullSolrCloudTest extends AbstractDistributedZkTestCase {
|
|||
}
|
||||
((HttpSolrServer) controlClient).shutdown();
|
||||
if (cloudClient != null) {
|
||||
cloudClient.close();
|
||||
cloudClient.shutdown();
|
||||
}
|
||||
if (zkStateReader != null) {
|
||||
zkStateReader.close();
|
||||
|
|
|
@ -365,4 +365,11 @@ public abstract class SolrServer implements Serializable
|
|||
}
|
||||
return binder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Release allocated resources.
|
||||
*
|
||||
* @since solr 4.0
|
||||
*/
|
||||
public abstract void shutdown();
|
||||
}
|
||||
|
|
|
@ -197,7 +197,8 @@ public class CloudSolrServer extends SolrServer {
|
|||
return rsp.getResponse();
|
||||
}
|
||||
|
||||
public void close() {
|
||||
@Override
|
||||
public void shutdown() {
|
||||
if (zkStateReader != null) {
|
||||
synchronized(this) {
|
||||
if (zkStateReader!= null)
|
||||
|
|
|
@ -354,6 +354,7 @@ public class ConcurrentUpdateSolrServer extends SolrServer {
|
|||
log.error("error", ex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
server.shutdown();
|
||||
scheduler.shutdown();
|
||||
|
|
|
@ -579,6 +579,7 @@ public class HttpSolrServer extends SolrServer {
|
|||
/**
|
||||
* Close the {@link ClientConnectionManager} from the internal client.
|
||||
*/
|
||||
@Override
|
||||
public void shutdown() {
|
||||
if (httpClient != null && internalClient) {
|
||||
httpClient.getConnectionManager().shutdown();
|
||||
|
|
|
@ -398,6 +398,7 @@ public class LBHttpSolrServer extends SolrServer {
|
|||
HttpClientUtil.setSoTimeout(httpClient, timeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
if (aliveCheckExecutor != null) {
|
||||
aliveCheckExecutor.shutdownNow();
|
||||
|
|
Loading…
Reference in New Issue