Skip to content

Commit

Permalink
[Rename] ElasticsearchCorruptionException class in server module (#167)
Browse files Browse the repository at this point in the history
This commit refactors the ElasticsearchCorruptionException in the server module
to OpenSearchCorruptionException. References and usages throughtout the rest of
the codebase are fully refactored.

Signed-off-by: Nicholas Knize <[email protected]>
  • Loading branch information
nknize committed Mar 22, 2021
1 parent e8b5a41 commit 27bd8cf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@
import java.io.IOException;

/**
* This exception is thrown when Elasticsearch detects
* This exception is thrown when OpenSearch detects
* an inconsistency in one of it's persistent files.
*/
public class ElasticsearchCorruptionException extends IOException {
public class OpenSearchCorruptionException extends IOException {

/**
* Creates a new {@link ElasticsearchCorruptionException}
* Creates a new {@link OpenSearchCorruptionException}
* @param message the exception message.
*/
public ElasticsearchCorruptionException(String message) {
public OpenSearchCorruptionException(String message) {
super(message);
}

/**
* Creates a new {@link ElasticsearchCorruptionException} with the given exceptions stacktrace.
* Creates a new {@link OpenSearchCorruptionException} with the given exceptions stacktrace.
* This constructor copies the stacktrace as well as the message from the given
* {@code Throwable} into this exception.
*
* @param ex the exception cause
*/
public ElasticsearchCorruptionException(Throwable ex) {
public OpenSearchCorruptionException(Throwable ex) {
super(ex);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
*/
package org.elasticsearch.gateway;

import org.elasticsearch.ElasticsearchCorruptionException;
import org.elasticsearch.OpenSearchCorruptionException;

/**
* This exception is thrown when Elasticsearch detects
* an inconsistency in one of it's persistent states.
*/
public class CorruptStateException extends ElasticsearchCorruptionException {
public class CorruptStateException extends OpenSearchCorruptionException {

/**
* Creates a new {@link CorruptStateException}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.elasticsearch.snapshots;

import org.elasticsearch.ElasticsearchCorruptionException;
import org.elasticsearch.OpenSearchCorruptionException;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.common.blobstore.BlobContainer;
import org.elasticsearch.common.blobstore.BlobMetadata;
Expand Down Expand Up @@ -140,7 +140,7 @@ public void testBlobCorruption() throws IOException {
try {
checksumFormat.read(blobContainer, "test-path", xContentRegistry());
fail("Should have failed due to corruption");
} catch (ElasticsearchCorruptionException ex) {
} catch (OpenSearchCorruptionException ex) {
assertThat(ex.getMessage(), containsString("test-path"));
} catch (EOFException ex) {
// This can happen if corrupt the byte length
Expand Down

0 comments on commit 27bd8cf

Please sign in to comment.