Class FileSettingsService

All Implemented Interfaces:
Closeable, AutoCloseable, ClusterStateListener, LifecycleComponent, Releasable

public class FileSettingsService extends MasterNodeFileWatchingService implements ClusterStateListener
File based settings applier service which watches an 'operator` directory inside the config directory.

The service expects that the operator directory will contain a single JSON file with all the settings that need to be applied to the cluster state. The name of the file is fixed to be settings.json. The operator directory name can be configured by setting the 'path.config.operator_directory' in the node properties.

The FileSettingsService is active always, but enabled only on the current master node. We register the service as a listener to cluster state changes, so that we can enable the file watcher thread when this node becomes a master node.