Skip to content

Commit 37abc41

Browse files
Remove Unused Snapshot Status Values (#54893) (#54906)
* Remove Unused Snapshot Status Values This is a left-over from before #41940 when we used the same status enum for the shards and the snapshots overall. The two removed values were never used on the shard level so we can simply remove them here.
1 parent d1d478d commit 37abc41

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,7 @@ public enum State {
427427
STARTED((byte) 1, false),
428428
SUCCESS((byte) 2, true),
429429
FAILED((byte) 3, true),
430-
ABORTED((byte) 4, false),
431-
MISSING((byte) 5, true),
432-
WAITING((byte) 6, false);
430+
ABORTED((byte) 4, false);
433431

434432
private final byte value;
435433

@@ -460,10 +458,6 @@ public static State fromValue(byte value) {
460458
return FAILED;
461459
case 4:
462460
return ABORTED;
463-
case 5:
464-
return MISSING;
465-
case 6:
466-
return WAITING;
467461
default:
468462
throw new IllegalArgumentException("No snapshot state for value [" + value + "]");
469463
}

server/src/test/java/org/elasticsearch/cluster/ClusterStateDiffIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ public ClusterState.Custom randomCreate(String name) {
716716
new Snapshot(randomName("repo"), new SnapshotId(randomName("snap"), UUIDs.randomBase64UUID())),
717717
randomBoolean(),
718718
randomBoolean(),
719-
SnapshotsInProgress.State.fromValue((byte) randomIntBetween(0, 6)),
719+
randomFrom(SnapshotsInProgress.State.values()),
720720
Collections.emptyList(),
721721
Math.abs(randomLong()),
722722
(long) randomIntBetween(0, 1000),

0 commit comments

Comments
 (0)