Rivers: Close rivers early allowing them to still do index operations, closes #1330.

This commit is contained in:
Shay Banon 2011-09-13 02:15:50 +03:00
parent 847938a88e
commit a84eb1fc8f
1 changed files with 7 additions and 3 deletions

View File

@ -208,6 +208,9 @@ public final class InternalNode implements Node {
if (settings.getAsBoolean("http.enabled", true)) { if (settings.getAsBoolean("http.enabled", true)) {
injector.getInstance(HttpServer.class).stop(); injector.getInstance(HttpServer.class).stop();
} }
injector.getInstance(RiversManager.class).stop();
// stop any changes happening as a result of cluster state changes // stop any changes happening as a result of cluster state changes
injector.getInstance(IndicesClusterStateService.class).stop(); injector.getInstance(IndicesClusterStateService.class).stop();
// we close indices first, so operations won't be allowed on it // we close indices first, so operations won't be allowed on it
@ -226,7 +229,6 @@ public final class InternalNode implements Node {
injector.getInstance(MonitorService.class).stop(); injector.getInstance(MonitorService.class).stop();
injector.getInstance(GatewayService.class).stop(); injector.getInstance(GatewayService.class).stop();
injector.getInstance(SearchService.class).stop(); injector.getInstance(SearchService.class).stop();
injector.getInstance(RiversManager.class).stop();
injector.getInstance(RestController.class).stop(); injector.getInstance(RestController.class).stop();
injector.getInstance(TransportService.class).stop(); injector.getInstance(TransportService.class).stop();
injector.getInstance(JmxService.class).close(); injector.getInstance(JmxService.class).close();
@ -256,6 +258,10 @@ public final class InternalNode implements Node {
if (settings.getAsBoolean("http.enabled", true)) { if (settings.getAsBoolean("http.enabled", true)) {
injector.getInstance(HttpServer.class).close(); injector.getInstance(HttpServer.class).close();
} }
stopWatch.stop().start("rivers");
injector.getInstance(RiversManager.class).close();
stopWatch.stop().start("client"); stopWatch.stop().start("client");
injector.getInstance(Client.class).close(); injector.getInstance(Client.class).close();
stopWatch.stop().start("indices_cluster"); stopWatch.stop().start("indices_cluster");
@ -277,8 +283,6 @@ public final class InternalNode implements Node {
injector.getInstance(GatewayService.class).close(); injector.getInstance(GatewayService.class).close();
stopWatch.stop().start("search"); stopWatch.stop().start("search");
injector.getInstance(SearchService.class).close(); injector.getInstance(SearchService.class).close();
stopWatch.stop().start("indexers");
injector.getInstance(RiversManager.class).close();
stopWatch.stop().start("rest"); stopWatch.stop().start("rest");
injector.getInstance(RestController.class).close(); injector.getInstance(RestController.class).close();
stopWatch.stop().start("transport"); stopWatch.stop().start("transport");