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

[Rename] ElasticsearchCorruptionException class in server module #167

Merged
Show file tree
Hide file tree
Changes from all commits
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
[Rename] ElasticsearchCorruptionException class in server module
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 <nknize@amazon.com>
  • Loading branch information
nknize committed Mar 2, 2021
commit 88525657a49eb83f11cb5ab14dd9c46f277aa397
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