Skip to content

Commit

Permalink
Remove unncessary debug statement and fix exception registeration
Browse files Browse the repository at this point in the history
Signed-off-by: Sumit Bansal <[email protected]>
  • Loading branch information
sumitasr committed Sep 29, 2024
1 parent 773fd8b commit 3e7bca2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import static org.opensearch.Version.V_2_10_0;
import static org.opensearch.Version.V_2_13_0;
import static org.opensearch.Version.V_2_17_0;
import static org.opensearch.Version.V_2_18_0;
import static org.opensearch.Version.V_2_1_0;
import static org.opensearch.Version.V_2_4_0;
import static org.opensearch.Version.V_2_5_0;
Expand Down Expand Up @@ -1210,6 +1211,14 @@ public static void registerExceptions() {
V_2_17_0
)
);
registerExceptionHandle(
new OpenSearchExceptionHandle(
org.opensearch.rest.ResponseLimitBreachedException.class,
org.opensearch.rest.ResponseLimitBreachedException::new,
175,
V_2_18_0
)
);
registerExceptionHandle(
new OpenSearchExceptionHandle(
org.opensearch.cluster.block.IndexCreateBlockException.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.io.IOException;

/**
* Thrown when api response limit threshold exceeds
* Thrown when api response breaches threshold limit.
*
* @opensearch.internal
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public static boolean isResponseLimitBreached(final RoutingTable routingTable, f
totalShards += entry.getValue().getShards().size();
if (totalShards > limit) return true;
}
System.out.println("Total Shards" + totalShards);
break;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
import org.opensearch.indices.replication.common.ReplicationFailedException;
import org.opensearch.ingest.IngestProcessorException;
import org.opensearch.repositories.RepositoryException;
import org.opensearch.rest.ResponseLimitBreachedException;
import org.opensearch.rest.action.admin.indices.AliasesNotFoundException;
import org.opensearch.search.SearchContextMissingException;
import org.opensearch.search.SearchException;
Expand Down Expand Up @@ -898,6 +899,7 @@ public void testIds() {
ids.put(172, ViewNotFoundException.class);
ids.put(173, ViewAlreadyExistsException.class);
ids.put(174, InvalidIndexContextException.class);
ids.put(175, ResponseLimitBreachedException.class);
ids.put(10001, IndexCreateBlockException.class);

Map<Class<? extends OpenSearchException>, Integer> reverse = new HashMap<>();
Expand Down

0 comments on commit 3e7bca2

Please sign in to comment.