Skip to content

Commit

Permalink
Update OpenSearchRejectedExecutionException import (#861)
Browse files Browse the repository at this point in the history
* Update OpenSearchRejectedExecutionException import

Signed-off-by: Jackie Han <jkhanjob@gmail.com>

* Update OpenSearchRejectedExecutionException import

Signed-off-by: Jackie Han <jkhanjob@gmail.com>

* Update OpenSearchRejectedExecutionException import

Signed-off-by: Jackie Han <jkhanjob@gmail.com>

* Update NodeInfo constructor and javadoc for isAdmin method

Signed-off-by: Jackie Han <jkhanjob@gmail.com>

---------

Signed-off-by: Jackie Han <jkhanjob@gmail.com>
  • Loading branch information
jackiehanyang authored Apr 12, 2023
1 parent b8df172 commit 1edc2ef
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException;
import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException;
import org.opensearch.core.xcontent.ToXContentObject;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.threadpool.ThreadPool;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/opensearch/ad/util/ExceptionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.opensearch.ad.common.exception.EndRunException;
import org.opensearch.ad.common.exception.LimitExceededException;
import org.opensearch.common.io.stream.NotSerializableExceptionWrapper;
import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException;
import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException;
import org.opensearch.index.IndexNotFoundException;
import org.opensearch.rest.RestStatus;

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/opensearch/ad/util/ParseUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ public static void onGetAdResponse(
}

/**
* 'all_access' role users are treated as admins.
* 'all_access' role users are treated as admins.
* @param user of the current role
* @return boolean if the role is admin
*/
public static boolean isAdmin(User user) {
if (user == null) {
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/opensearch/ad/cluster/HashRingTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ private NodeInfo createNodeInfo(DiscoveryNode node, String version) {
pluginsAndModules,
null,
null,
null,
null
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException;
import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException;

import test.org.opensearch.ad.util.LabelledAnomalyGenerator;
import test.org.opensearch.ad.util.MLUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException;
import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException;
import org.opensearch.index.IndexNotFoundException;
import org.opensearch.index.get.GetResult;
import org.opensearch.index.seqno.SequenceNumbers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException;
import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException;
import org.opensearch.index.Index;
import org.opensearch.index.engine.VersionConflictEngineException;
import org.opensearch.index.shard.ShardId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException;
import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException;
import org.opensearch.rest.RestStatus;

import test.org.opensearch.ad.util.MLUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException;
import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.rest.RestStatus;
import org.opensearch.threadpool.ThreadPool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.opensearch.ad.model.AnomalyResult;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException;
import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException;

public class AnomalyResultHandlerTests extends AbstractIndexHandlerTest {
@Mock
Expand Down

0 comments on commit 1edc2ef

Please sign in to comment.