[Rename] Refactor o.e.watcher (#399)

This commit refactors the o.e.watcher package.  References throughout the codebase are also refactored.

Signed-off-by: Himanshu Setia <setiah@amazon.com>
This commit is contained in:
Himanshu Setia 2021-03-18 14:46:43 -07:00 committed by Nick Knize
parent d1e275c4e9
commit 8e711ab922
19 changed files with 36 additions and 31 deletions

View File

@ -140,7 +140,7 @@ import org.opensearch.repositories.RepositoriesService;
import org.opensearch.script.ScriptContext;
import org.opensearch.script.ScriptService;
import org.opensearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.ResourceWatcherService;
import org.tartarus.snowball.ext.DutchStemmer;
import org.tartarus.snowball.ext.FrenchStemmer;

View File

@ -55,7 +55,7 @@ import org.opensearch.script.ScriptEngine;
import org.opensearch.script.ScriptService;
import org.opensearch.search.aggregations.pipeline.MovingFunctionScript;
import org.opensearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.ResourceWatcherService;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -46,7 +46,7 @@ import org.opensearch.rest.RestHandler;
import org.opensearch.script.ScriptService;
import org.opensearch.tasks.Task;
import org.opensearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.ResourceWatcherService;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -31,9 +31,9 @@ import org.opensearch.common.ssl.SslConfiguration;
import org.opensearch.common.ssl.SslConfigurationKeys;
import org.opensearch.common.ssl.SslConfigurationLoader;
import org.opensearch.env.Environment;
import org.elasticsearch.watcher.FileChangesListener;
import org.elasticsearch.watcher.FileWatcher;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.FileChangesListener;
import org.opensearch.watcher.FileWatcher;
import org.opensearch.watcher.ResourceWatcherService;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;

View File

@ -28,7 +28,7 @@ import org.opensearch.env.Environment;
import org.opensearch.env.TestEnvironment;
import org.elasticsearch.index.query.MatchAllQueryBuilder;
import org.elasticsearch.index.reindex.RemoteInfo;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.ResourceWatcherService;
import java.util.ArrayList;
import java.util.HashMap;

View File

@ -56,7 +56,7 @@ import org.opensearch.tasks.Task;
import org.opensearch.test.OpenSearchSingleNodeTestCase;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.Netty4Plugin;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.ResourceWatcherService;
import org.junit.Before;
import java.util.Arrays;

View File

@ -37,7 +37,7 @@ import org.opensearch.env.TestEnvironment;
import org.elasticsearch.index.reindex.RemoteInfo;
import org.elasticsearch.mocksocket.MockHttpServer;
import org.opensearch.test.OpenSearchTestCase;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.ResourceWatcherService;
import org.hamcrest.Matchers;
import org.junit.AfterClass;
import org.junit.BeforeClass;

View File

@ -37,7 +37,7 @@ import org.opensearch.repositories.RepositoriesService;
import org.opensearch.script.ScriptService;
import org.opensearch.threadpool.Scheduler;
import org.opensearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.ResourceWatcherService;
import java.util.Collection;
import java.util.Collections;

View File

@ -19,7 +19,7 @@
package org.opensearch.common.settings;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.ResourceWatcherService;
import org.opensearch.action.admin.cluster.configuration.TransportAddVotingConfigExclusionsAction;
import org.opensearch.action.admin.indices.close.TransportCloseIndexAction;
import org.opensearch.action.search.TransportSearchAction;

View File

@ -23,7 +23,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.lucene.util.Constants;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.ResourceWatcherService;
import org.opensearch.Assertions;
import org.opensearch.Build;
import org.opensearch.OpenSearchException;

View File

@ -19,7 +19,7 @@
package org.opensearch.plugins;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.ResourceWatcherService;
import org.opensearch.bootstrap.BootstrapCheck;
import org.opensearch.client.Client;
import org.opensearch.cluster.ClusterState;

View File

@ -7,7 +7,7 @@
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.watcher;
package org.opensearch.watcher;
import java.io.IOException;
import java.util.List;

View File

@ -7,7 +7,7 @@
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.watcher;
package org.opensearch.watcher;
import java.nio.file.Path;

View File

@ -7,7 +7,7 @@
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.watcher;
package org.opensearch.watcher;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

View File

@ -7,7 +7,7 @@
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.watcher;
package org.opensearch.watcher;
import java.io.IOException;

View File

@ -7,7 +7,7 @@
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.watcher;
package org.opensearch.watcher;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -36,8 +36,8 @@ import java.util.concurrent.CopyOnWriteArraySet;
/**
* Generic resource watcher service
*
* Other elasticsearch services can register their resource watchers with this service using {@link #add(ResourceWatcher)}
* method. This service will call {@link org.elasticsearch.watcher.ResourceWatcher#checkAndNotify()} method of all
* Other opensearch services can register their resource watchers with this service using {@link #add(ResourceWatcher)}
* method. This service will call {@link org.opensearch.watcher.ResourceWatcher#checkAndNotify()} method of all
* registered watcher periodically. The frequency of checks can be specified using {@code resource.reload.interval} setting, which
* defaults to {@code 60s}. The service can be disabled by setting {@code resource.reload.enabled} setting to {@code false}.
*/

View File

@ -7,7 +7,7 @@
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@ -17,7 +17,7 @@
* under the License.
*/
package org.elasticsearch.watcher;
package org.opensearch.watcher;
public class WatcherHandle<W extends ResourceWatcher> {

View File

@ -7,7 +7,7 @@
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@ -16,11 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.watcher;
package org.opensearch.watcher;
import org.opensearch.core.internal.io.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.watcher.FileChangesListener;
import org.opensearch.watcher.FileWatcher;
import java.io.BufferedWriter;
import java.io.IOException;

View File

@ -7,7 +7,7 @@
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@ -17,12 +17,15 @@
* under the License.
*/
package org.elasticsearch.watcher;
package org.opensearch.watcher;
import org.opensearch.common.settings.Settings;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.threadpool.TestThreadPool;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.watcher.ResourceWatcher;
import org.opensearch.watcher.ResourceWatcherService;
import org.opensearch.watcher.WatcherHandle;
import static org.opensearch.common.unit.TimeValue.timeValueSeconds;
import static org.hamcrest.Matchers.equalTo;