forked from opensearch-project/k-NN
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add KnnCircuitBreakerException and modify exception message (opensear…
…ch-project#1688) * Add KnnCircuitBreakerException and modify exception message Signed-off-by: Ryan Bogan <[email protected]> * Add changelog entry and remove star import Signed-off-by: Ryan Bogan <[email protected]> * Remove default exception constructor Signed-off-by: Ryan Bogan <[email protected]> * Add class description and change parameter Signed-off-by: Ryan Bogan <[email protected]> * Fix javadocs Signed-off-by: Ryan Bogan <[email protected]> --------- Signed-off-by: Ryan Bogan <[email protected]>
- Loading branch information
Showing
4 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/main/java/org/opensearch/knn/index/KnnCircuitBreakerException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.knn.index; | ||
|
||
/** | ||
* An exception to be thrown when the k-NN circuit breaker is triggered. | ||
*/ | ||
public class KnnCircuitBreakerException extends RuntimeException { | ||
|
||
/** | ||
* Constructs a KnnCircuitBreakerException with the specified detail | ||
* message. A detail message is a String that describes this particular | ||
* exception. | ||
* | ||
* @param message the String that contains a detailed message | ||
*/ | ||
public KnnCircuitBreakerException(final String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs a new exception with the specified detail message and | ||
* cause. | ||
* | ||
* <p>Note that the detail message associated with {@code cause} is | ||
* <i>not</i> automatically incorporated in this exception's detail | ||
* message. | ||
* | ||
* @param message the detail message (which is saved for later retrieval | ||
* by the {@link Throwable#getMessage()} method). | ||
* @param cause the cause (which is saved for later retrieval by the | ||
* {@link Throwable#getCause()} method). (A {@code null} value | ||
* is permitted, and indicates that the cause is nonexistent or | ||
* unknown.) | ||
*/ | ||
public KnnCircuitBreakerException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
/** | ||
* Constructs a new exception with the specified cause and a detail | ||
* message of {@code (cause==null ? null : cause.toString())} (which | ||
* typically contains the class and detail message of {@code cause}). | ||
* This constructor is useful for exceptions that are little more than | ||
* wrappers for other throwables (for example, {@link | ||
* java.security.PrivilegedActionException}). | ||
* | ||
* @param cause the cause (which is saved for later retrieval by the | ||
* {@link Throwable#getCause()} method). (A {@code null} value is | ||
* permitted, and indicates that the cause is nonexistent or | ||
* unknown.) | ||
*/ | ||
public KnnCircuitBreakerException(Throwable cause) { | ||
super(cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters