MINOR: Cleanup Dead Code in Snapshots Package (#36528)
This commit is contained in:
parent
ff5dd14753
commit
02d0f163a4
|
@ -183,18 +183,6 @@ public class RestoreInfo implements ToXContentObject, Streamable {
|
|||
out.writeVInt(successfulShards);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads restore info from {@link StreamInput}
|
||||
*
|
||||
* @param in stream input
|
||||
* @return restore info
|
||||
*/
|
||||
public static RestoreInfo readRestoreInfo(StreamInput in) throws IOException {
|
||||
RestoreInfo snapshotInfo = new RestoreInfo();
|
||||
snapshotInfo.readFrom(in);
|
||||
return snapshotInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads optional restore info from {@link StreamInput}
|
||||
*
|
||||
|
|
|
@ -28,18 +28,10 @@ import java.io.IOException;
|
|||
*/
|
||||
public class SnapshotCreationException extends SnapshotException {
|
||||
|
||||
public SnapshotCreationException(final String repositoryName, final String snapshotName, final Throwable cause) {
|
||||
super(repositoryName, snapshotName, "failed to create snapshot", cause);
|
||||
}
|
||||
|
||||
public SnapshotCreationException(final String repositoryName, final SnapshotId snapshotId, final Throwable cause) {
|
||||
super(repositoryName, snapshotId, "failed to create snapshot", cause);
|
||||
}
|
||||
|
||||
public SnapshotCreationException(final String repositoryName, final SnapshotId snapshotId, final String msg) {
|
||||
super(repositoryName, snapshotId, msg);
|
||||
}
|
||||
|
||||
public SnapshotCreationException(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
|
|
@ -562,14 +562,6 @@ public final class SnapshotInfo implements Comparable<SnapshotInfo>, ToXContent,
|
|||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method creates a SnapshotInfo from external x-content. It does not
|
||||
* handle x-content written with the internal version.
|
||||
*/
|
||||
public static SnapshotInfo fromXContent(final XContentParser parser) throws IOException {
|
||||
return SNAPSHOT_INFO_PARSER.parse(parser, null).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method creates a SnapshotInfo from internal x-content. It does not
|
||||
* handle x-content written with the external version as external x-content
|
||||
|
|
|
@ -33,10 +33,6 @@ public class SnapshotMissingException extends SnapshotException {
|
|||
super(repositoryName, snapshotId, "is missing", cause);
|
||||
}
|
||||
|
||||
public SnapshotMissingException(final String repositoryName, final SnapshotId snapshotId) {
|
||||
super(repositoryName, snapshotId, "is missing");
|
||||
}
|
||||
|
||||
public SnapshotMissingException(final String repositoryName, final String snapshotName) {
|
||||
super(repositoryName, snapshotName, "is missing");
|
||||
}
|
||||
|
@ -49,5 +45,4 @@ public class SnapshotMissingException extends SnapshotException {
|
|||
public RestStatus status() {
|
||||
return RestStatus.NOT_FOUND;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,10 +31,6 @@ public class SnapshotRestoreException extends SnapshotException {
|
|||
super(repositoryName, snapshotName, message);
|
||||
}
|
||||
|
||||
public SnapshotRestoreException(final String repositoryName, final String snapshotName, final String message, final Throwable cause) {
|
||||
super(repositoryName, snapshotName, message, cause);
|
||||
}
|
||||
|
||||
public SnapshotRestoreException(final Snapshot snapshot, final String message) {
|
||||
super(snapshot, message);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.elasticsearch.common.ParseField;
|
|||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
|
@ -125,19 +124,6 @@ public class SnapshotShardFailure extends ShardOperationFailedException {
|
|||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes snapshot failure information into JSON
|
||||
*
|
||||
* @param snapshotShardFailure snapshot failure information
|
||||
* @param builder XContent builder
|
||||
* @param params additional parameters
|
||||
*/
|
||||
public static void toXContent(SnapshotShardFailure snapshotShardFailure, XContentBuilder builder, ToXContent.Params params) throws IOException {
|
||||
builder.startObject();
|
||||
snapshotShardFailure.toXContent(builder, params);
|
||||
builder.endObject();
|
||||
}
|
||||
|
||||
static final ConstructingObjectParser<SnapshotShardFailure, Void> SNAPSHOT_SHARD_FAILURE_PARSER =
|
||||
new ConstructingObjectParser<>("shard_failure", true, SnapshotShardFailure::constructSnapshotShardFailure);
|
||||
|
||||
|
|
Loading…
Reference in New Issue