Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate public class names with master terminology #3871

Merged
merged 15 commits into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Register back MasterNotDiscoveredException and NotMasterException
Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Jul 12, 2022
commit ad991b724186a47c83473d9f3b42fbd70ae69e72
33 changes: 28 additions & 5 deletions server/src/main/java/org/opensearch/OpenSearchException.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
package org.opensearch;

import org.opensearch.action.support.replication.ReplicationOperation;
import org.opensearch.cluster.NotClusterManagerException;
import org.opensearch.cluster.action.shard.ShardStateAction;
import org.opensearch.common.CheckedFunction;
import org.opensearch.common.Nullable;
Expand All @@ -47,7 +46,6 @@
import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentParseException;
import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.discovery.ClusterManagerNotDiscoveredException;
import org.opensearch.index.Index;
import org.opensearch.index.shard.ShardId;
import org.opensearch.rest.RestStatus;
Expand Down Expand Up @@ -791,8 +789,18 @@ private enum OpenSearchExceptionHandle {
UNKNOWN_VERSION_ADDED
),
CLUSTER_MANAGER_NOT_DISCOVERED_EXCEPTION(
ClusterManagerNotDiscoveredException.class,
ClusterManagerNotDiscoveredException::new,
org.opensearch.discovery.ClusterManagerNotDiscoveredException.class,
org.opensearch.discovery.ClusterManagerNotDiscoveredException::new,
3,
UNKNOWN_VERSION_ADDED
),
/**
* @deprecated As of 2.2, because supporting inclusive language, replaced by CLUSTER_MANAGER_NOT_DISCOVERED_EXCEPTION
*/
@Deprecated
MASTER_NOT_DISCOVERED_EXCEPTION(
org.opensearch.discovery.MasterNotDiscoveredException.class,
org.opensearch.discovery.MasterNotDiscoveredException::new,
3,
UNKNOWN_VERSION_ADDED
),
Expand Down Expand Up @@ -1501,7 +1509,22 @@ private enum OpenSearchExceptionHandle {
143,
UNKNOWN_VERSION_ADDED
),
NOT_CLUSTER_MANAGER_EXCEPTION(NotClusterManagerException.class, NotClusterManagerException::new, 144, UNKNOWN_VERSION_ADDED),
NOT_CLUSTER_MANAGER_EXCEPTION(
org.opensearch.cluster.NotClusterManagerException.class,
org.opensearch.cluster.NotClusterManagerException::new,
144,
UNKNOWN_VERSION_ADDED
),
/**
* @deprecated As of 2.2, because supporting inclusive language, replaced by NOT_CLUSTER_MANAGER_EXCEPTION
*/
@Deprecated
NOT_MASTER_EXCEPTION(
org.opensearch.cluster.NotMasterException.class,
org.opensearch.cluster.NotMasterException::new,
144,
UNKNOWN_VERSION_ADDED
),
STATUS_EXCEPTION(
org.opensearch.OpenSearchStatusException.class,
org.opensearch.OpenSearchStatusException::new,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

package org.opensearch.discovery;

import org.opensearch.common.io.stream.StreamInput;

import java.io.IOException;

/**
* Exception when the cluster-manager is not discovered
*
Expand All @@ -53,4 +57,7 @@ public MasterNotDiscoveredException(String message) {
super(message);
}

public MasterNotDiscoveredException(StreamInput in) throws IOException {
super(in);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import org.opensearch.action.search.ShardSearchFailure;
import org.opensearch.action.support.replication.ReplicationOperation;
import org.opensearch.client.AbstractClientHeadersTestCase;
import org.opensearch.cluster.NotClusterManagerException;
import org.opensearch.cluster.action.shard.ShardStateAction;
import org.opensearch.cluster.block.ClusterBlockException;
import org.opensearch.cluster.coordination.CoordinationStateRejectedException;
Expand All @@ -70,7 +69,6 @@
import org.opensearch.common.util.CancellableThreadsTests;
import org.opensearch.common.util.set.Sets;
import org.opensearch.common.xcontent.XContentLocation;
import org.opensearch.discovery.ClusterManagerNotDiscoveredException;
import org.opensearch.env.ShardLockObtainFailedException;
import org.opensearch.index.Index;
import org.opensearch.index.engine.RecoveryEngineException;
Expand Down Expand Up @@ -697,7 +695,7 @@ public void testIds() {
ids.put(0, org.opensearch.index.snapshots.IndexShardSnapshotFailedException.class);
ids.put(1, org.opensearch.search.dfs.DfsPhaseExecutionException.class);
ids.put(2, org.opensearch.common.util.CancellableThreads.ExecutionCancelledException.class);
ids.put(3, ClusterManagerNotDiscoveredException.class);
ids.put(3, org.opensearch.discovery.ClusterManagerNotDiscoveredException.class);
ids.put(4, org.opensearch.OpenSearchSecurityException.class);
ids.put(5, org.opensearch.index.snapshots.IndexShardRestoreException.class);
ids.put(6, org.opensearch.indices.IndexClosedException.class);
Expand Down Expand Up @@ -835,7 +833,7 @@ public void testIds() {
ids.put(141, org.opensearch.index.query.QueryShardException.class);
ids.put(142, ShardStateAction.NoLongerPrimaryShardException.class);
ids.put(143, org.opensearch.script.ScriptException.class);
ids.put(144, NotClusterManagerException.class);
ids.put(144, org.opensearch.cluster.NotClusterManagerException.class);
ids.put(145, org.opensearch.OpenSearchStatusException.class);
ids.put(146, org.opensearch.tasks.TaskCancelledException.class);
ids.put(147, org.opensearch.env.ShardLockObtainFailedException.class);
Expand Down