Skip to content

Commit

Permalink
Remove Unused Snapshot Status Values (#54893)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
original-brownbear authored Apr 7, 2020
1 parent 4f0ccd3 commit 4791e08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,7 @@ public enum State {
STARTED((byte) 1, false),
SUCCESS((byte) 2, true),
FAILED((byte) 3, true),
ABORTED((byte) 4, false),
MISSING((byte) 5, true),
WAITING((byte) 6, false);
ABORTED((byte) 4, false);

private final byte value;

Expand Down Expand Up @@ -460,10 +458,6 @@ public static State fromValue(byte value) {
return FAILED;
case 4:
return ABORTED;
case 5:
return MISSING;
case 6:
return WAITING;
default:
throw new IllegalArgumentException("No snapshot state for value [" + value + "]");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ public ClusterState.Custom randomCreate(String name) {
new Snapshot(randomName("repo"), new SnapshotId(randomName("snap"), UUIDs.randomBase64UUID())),
randomBoolean(),
randomBoolean(),
SnapshotsInProgress.State.fromValue((byte) randomIntBetween(0, 6)),
randomFrom(SnapshotsInProgress.State.values()),
Collections.emptyList(),
Math.abs(randomLong()),
(long) randomIntBetween(0, 1000),
Expand Down

0 comments on commit 4791e08

Please sign in to comment.