|
@@ -136,13 +136,6 @@ public class WatcherService {
|
|
* @return true if everything is good to go, so that the service can be started
|
|
* @return true if everything is good to go, so that the service can be started
|
|
*/
|
|
*/
|
|
public boolean validate(ClusterState state) {
|
|
public boolean validate(ClusterState state) {
|
|
- // template check makes only sense for non existing indices, we could refine this
|
|
|
|
- boolean hasValidWatcherTemplates = WatcherIndexTemplateRegistry.validate(state);
|
|
|
|
- if (hasValidWatcherTemplates == false) {
|
|
|
|
- logger.debug("missing watcher index templates, not starting watcher service");
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
IndexMetadata watcherIndexMetadata = WatchStoreUtils.getConcreteIndex(Watch.INDEX, state.metadata());
|
|
IndexMetadata watcherIndexMetadata = WatchStoreUtils.getConcreteIndex(Watch.INDEX, state.metadata());
|
|
IndexMetadata triggeredWatchesIndexMetadata = WatchStoreUtils.getConcreteIndex(
|
|
IndexMetadata triggeredWatchesIndexMetadata = WatchStoreUtils.getConcreteIndex(
|
|
TriggeredWatchStoreField.INDEX_NAME,
|
|
TriggeredWatchStoreField.INDEX_NAME,
|
|
@@ -211,6 +204,10 @@ public class WatcherService {
|
|
* @param state cluster state, which is needed to find out about local shards
|
|
* @param state cluster state, which is needed to find out about local shards
|
|
*/
|
|
*/
|
|
void reload(ClusterState state, String reason) {
|
|
void reload(ClusterState state, String reason) {
|
|
|
|
+ boolean hasValidWatcherTemplates = WatcherIndexTemplateRegistry.validate(state);
|
|
|
|
+ if (hasValidWatcherTemplates == false) {
|
|
|
|
+ logger.warn("missing watcher index templates");
|
|
|
|
+ }
|
|
// this method contains the only async code block, being called by the cluster state listener
|
|
// this method contains the only async code block, being called by the cluster state listener
|
|
// the reason for this is, that loading he watches is done in a sync manner and thus cannot be done on the cluster state listener
|
|
// the reason for this is, that loading he watches is done in a sync manner and thus cannot be done on the cluster state listener
|
|
// thread
|
|
// thread
|