Skip to content

Commit

Permalink
Remove deprecated exception classes from the unregistered exception l…
Browse files Browse the repository at this point in the history
…ist in ExceptionSerializationTests

Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Jul 13, 2022
1 parent 2d826b6 commit a862943
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
20 changes: 0 additions & 20 deletions server/src/main/java/org/opensearch/OpenSearchException.java
Original file line number Diff line number Diff line change
Expand Up @@ -794,16 +794,6 @@ private enum OpenSearchExceptionHandle {
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
),
OPENSEARCH_SECURITY_EXCEPTION(
org.opensearch.OpenSearchSecurityException.class,
org.opensearch.OpenSearchSecurityException::new,
Expand Down Expand Up @@ -1515,16 +1505,6 @@ private enum OpenSearchExceptionHandle {
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 @@ -44,6 +44,7 @@
import org.opensearch.action.search.ShardSearchFailure;
import org.opensearch.action.support.replication.ReplicationOperation;
import org.opensearch.client.AbstractClientHeadersTestCase;
import org.opensearch.cluster.NotMasterException;
import org.opensearch.cluster.action.shard.ShardStateAction;
import org.opensearch.cluster.block.ClusterBlockException;
import org.opensearch.cluster.coordination.CoordinationStateRejectedException;
Expand All @@ -69,6 +70,7 @@
import org.opensearch.common.util.CancellableThreadsTests;
import org.opensearch.common.util.set.Sets;
import org.opensearch.common.xcontent.XContentLocation;
import org.opensearch.discovery.MasterNotDiscoveredException;
import org.opensearch.env.ShardLockObtainFailedException;
import org.opensearch.index.Index;
import org.opensearch.index.engine.RecoveryEngineException;
Expand Down Expand Up @@ -235,6 +237,9 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOEx
Files.walkFileTree(testStartPath, visitor);
assertTrue(notRegistered.remove(TestException.class));
assertTrue(notRegistered.remove(UnknownHeaderException.class));
// Remove the deprecated exception classes from the unregistered list.
assertTrue(notRegistered.remove(NotMasterException.class));
assertTrue(notRegistered.remove(MasterNotDiscoveredException.class));
assertTrue("Classes subclassing OpenSearchException must be registered \n" + notRegistered.toString(), notRegistered.isEmpty());
assertTrue(registered.removeAll(OpenSearchException.getRegisteredKeys())); // check
assertEquals(registered.toString(), 0, registered.size());
Expand Down

0 comments on commit a862943

Please sign in to comment.