Skip to content

Commit ae7be72

Browse files
MINOR: Cleanup Dead Code in Snapshots Package (elastic#36528)
1 parent 15520f7 commit ae7be72

File tree

6 files changed

+0
-51
lines changed

6 files changed

+0
-51
lines changed

server/src/main/java/org/elasticsearch/snapshots/RestoreInfo.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,6 @@ public void writeTo(StreamOutput out) throws IOException {
183183
out.writeVInt(successfulShards);
184184
}
185185

186-
/**
187-
* Reads restore info from {@link StreamInput}
188-
*
189-
* @param in stream input
190-
* @return restore info
191-
*/
192-
public static RestoreInfo readRestoreInfo(StreamInput in) throws IOException {
193-
RestoreInfo snapshotInfo = new RestoreInfo();
194-
snapshotInfo.readFrom(in);
195-
return snapshotInfo;
196-
}
197-
198186
/**
199187
* Reads optional restore info from {@link StreamInput}
200188
*

server/src/main/java/org/elasticsearch/snapshots/SnapshotCreationException.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,10 @@
2828
*/
2929
public class SnapshotCreationException extends SnapshotException {
3030

31-
public SnapshotCreationException(final String repositoryName, final String snapshotName, final Throwable cause) {
32-
super(repositoryName, snapshotName, "failed to create snapshot", cause);
33-
}
34-
3531
public SnapshotCreationException(final String repositoryName, final SnapshotId snapshotId, final Throwable cause) {
3632
super(repositoryName, snapshotId, "failed to create snapshot", cause);
3733
}
3834

39-
public SnapshotCreationException(final String repositoryName, final SnapshotId snapshotId, final String msg) {
40-
super(repositoryName, snapshotId, msg);
41-
}
42-
4335
public SnapshotCreationException(StreamInput in) throws IOException {
4436
super(in);
4537
}

server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -568,14 +568,6 @@ private XContentBuilder toXContentInternal(final XContentBuilder builder, final
568568
return builder;
569569
}
570570

571-
/**
572-
* This method creates a SnapshotInfo from external x-content. It does not
573-
* handle x-content written with the internal version.
574-
*/
575-
public static SnapshotInfo fromXContent(final XContentParser parser) throws IOException {
576-
return SNAPSHOT_INFO_PARSER.parse(parser, null).build();
577-
}
578-
579571
/**
580572
* This method creates a SnapshotInfo from internal x-content. It does not
581573
* handle x-content written with the external version as external x-content

server/src/main/java/org/elasticsearch/snapshots/SnapshotMissingException.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ public SnapshotMissingException(final String repositoryName, final SnapshotId sn
3333
super(repositoryName, snapshotId, "is missing", cause);
3434
}
3535

36-
public SnapshotMissingException(final String repositoryName, final SnapshotId snapshotId) {
37-
super(repositoryName, snapshotId, "is missing");
38-
}
39-
4036
public SnapshotMissingException(final String repositoryName, final String snapshotName) {
4137
super(repositoryName, snapshotName, "is missing");
4238
}
@@ -49,5 +45,4 @@ public SnapshotMissingException(StreamInput in) throws IOException {
4945
public RestStatus status() {
5046
return RestStatus.NOT_FOUND;
5147
}
52-
5348
}

server/src/main/java/org/elasticsearch/snapshots/SnapshotRestoreException.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ public SnapshotRestoreException(final String repositoryName, final String snapsh
3131
super(repositoryName, snapshotName, message);
3232
}
3333

34-
public SnapshotRestoreException(final String repositoryName, final String snapshotName, final String message, final Throwable cause) {
35-
super(repositoryName, snapshotName, message, cause);
36-
}
37-
3834
public SnapshotRestoreException(final Snapshot snapshot, final String message) {
3935
super(snapshot, message);
4036
}

server/src/main/java/org/elasticsearch/snapshots/SnapshotShardFailure.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.elasticsearch.common.io.stream.StreamInput;
2828
import org.elasticsearch.common.io.stream.StreamOutput;
2929
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
30-
import org.elasticsearch.common.xcontent.ToXContent;
3130
import org.elasticsearch.common.xcontent.XContentBuilder;
3231
import org.elasticsearch.common.xcontent.XContentParser;
3332
import org.elasticsearch.index.shard.ShardId;
@@ -125,19 +124,6 @@ public String toString() {
125124
'}';
126125
}
127126

128-
/**
129-
* Serializes snapshot failure information into JSON
130-
*
131-
* @param snapshotShardFailure snapshot failure information
132-
* @param builder XContent builder
133-
* @param params additional parameters
134-
*/
135-
public static void toXContent(SnapshotShardFailure snapshotShardFailure, XContentBuilder builder, ToXContent.Params params) throws IOException {
136-
builder.startObject();
137-
snapshotShardFailure.toXContent(builder, params);
138-
builder.endObject();
139-
}
140-
141127
static final ConstructingObjectParser<SnapshotShardFailure, Void> SNAPSHOT_SHARD_FAILURE_PARSER =
142128
new ConstructingObjectParser<>("shard_failure", true, SnapshotShardFailure::constructSnapshotShardFailure);
143129

0 commit comments

Comments
 (0)