-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce ShardState Enum + Slight Cleanup SnapshotsInProgress #41940
Introduce ShardState Enum + Slight Cleanup SnapshotsInProgress #41940
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 elastic#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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -42,23 +42,78 @@ | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Objects; | |||
|
|||
/** | |||
* Meta data about snapshots that are currently executing | |||
*/ | |||
public class SnapshotsInProgress extends AbstractNamedDiffable<Custom> implements Custom { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Jenkins run elasticsearch-ci/1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
…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
This is a left-over from before elastic#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.
* Remove Unused Snapshot Status Values This is a left-over from before elastic#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
computeIfAbsent
to make up for adding 50 new lines to this class