File tree 1 file changed +4
-3
lines changed
plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ private synchronized void start(ClusterState state) {
87
87
if (shutDown ) {
88
88
return ;
89
89
}
90
- WatcherState watcherState = watcherService .state ();
90
+ final WatcherState watcherState = watcherService .state ();
91
91
if (watcherState != WatcherState .STOPPED ) {
92
92
logger .debug ("not starting watcher. watcher can only start if its current state is [{}], but its current state now is [{}]" ,
93
93
WatcherState .STOPPED , watcherState );
@@ -162,9 +162,10 @@ public void clusterChanged(ClusterChangedEvent event) {
162
162
clearAllocationIds ();
163
163
executor .execute (() -> this .stop ("watcher manually marked to shutdown by cluster state update" ));
164
164
} else {
165
- if (watcherService .state () == WatcherState .STARTED && event .state ().nodes ().getLocalNode ().isDataNode ()) {
165
+ final WatcherState watcherState = watcherService .state ();
166
+ if (watcherState == WatcherState .STARTED && event .state ().nodes ().getLocalNode ().isDataNode ()) {
166
167
checkAndSetAllocationIds (event .state (), true );
167
- } else if (watcherService . state () != WatcherState .STARTED && watcherService . state () != WatcherState .STARTING ) {
168
+ } else if (watcherState != WatcherState .STARTED && watcherState != WatcherState .STARTING ) {
168
169
IndexMetaData watcherIndexMetaData = WatchStoreUtils .getConcreteIndex (Watch .INDEX , event .state ().metaData ());
169
170
IndexMetaData triggeredWatchesIndexMetaData = WatchStoreUtils .getConcreteIndex (TriggeredWatchStoreField .INDEX_NAME ,
170
171
event .state ().metaData ());
You can’t perform that action at this time.
0 commit comments