Introduce ShardState Enum + Slight Cleanup SnapshotsInProgress#41940
Introduce ShardState Enum + Slight Cleanup SnapshotsInProgress#41940original-brownbear merged 9 commits intoelastic:masterfrom original-brownbear:cleanup-shard-state-enum
Conversation
* Added separate enum for the state of each shard, it was really confusing that we used the same enum for the state of the snapshot overall and the state of each individual shard * relates #40943 (comment) * Moved the contents of the class around a little so fields, constructors and nested classes/enums aren't all over the place especially now that we have yet another nested enum here * Shortened some obvious spots in equals method and saved a few lines via `computeIfAbsent` to make up for adding 50 new lines to this class
|
Pinging @elastic/es-distributed |
|
Jenkins run elasticsearch-ci/1 |
andrershov
left a comment
There was a problem hiding this comment.
I'd rather rename this PR to introduce ShardState enum, because it's not so vague as Cleanup SnapshotsInProgress. I think it's ok if computeIfAbsent change will be part of this PR.
| /** | ||
| * Meta data about snapshots that are currently executing | ||
| */ | ||
| public class SnapshotsInProgress extends AbstractNamedDiffable<Custom> implements Custom { |
There was a problem hiding this comment.
This diff is not readable, can you please move things back in the file. It would be much easier for the reviewers to see what exactly was changed and you won't be displayed in git history as the author for the lines that you have just re-shuffled.
There was a problem hiding this comment.
Sure we can shuffle that later :), reverted that part and fixed PR title.
|
Jenkins run elasticsearch-ci/2 |
|
@andrershov ping :) (bwc is apparently broken due to the version bumps right now) |
|
Jenkins run elasticsearch-ci/1 |
|
Jenkins run elasticsearch-ci/bwc |
1 similar comment
|
Jenkins run elasticsearch-ci/bwc |
…ic#41940) * Added separate enum for the state of each shard, it was really confusing that we used the same enum for the state of the snapshot overall and the state of each individual shard * relates elastic#40943 (comment) * Shortened some obvious spots in equals method and saved a few lines via `computeIfAbsent` to make up for adding 50 new lines to this class
… (#42573) * Added separate enum for the state of each shard, it was really confusing that we used the same enum for the state of the snapshot overall and the state of each individual shard * relates #40943 (comment) * Shortened some obvious spots in equals method and saved a few lines via `computeIfAbsent` to make up for adding 50 new lines to this class
* 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.
* 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.
confusing that we used the same enum for the state of the snapshot
overall and the state of each individual shard
constructors and nested classes/enums aren't all over the place
especially now that we have yet another nested enum here
via
computeIfAbsentto make up for adding 50 new lines to this class