Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
gwbrown committed Feb 1, 2019
1 parent 1de1466 commit 906da63
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
import java.util.Arrays;
import java.util.Objects;

/**
* A step that waits until the index it's used on is no longer a leader index.
* This is necessary as there are some actions which are not safe to perform on
* a leader index, such as those which delete the index, including Shrink and
* Delete.
*/
public class WaitForNoFollowersStep extends AsyncWaitStep {

private static final Logger logger = LogManager.getLogger(WaitForNoFollowersStep.class);
Expand Down Expand Up @@ -66,11 +72,10 @@ static final class Info implements ToXContentObject {

static final ParseField MESSAGE_FIELD = new ParseField("message");

private final String message;
private static final String message = "this index is a leader index; waiting for all following indices to cease " +
"following before proceeding";

Info() {
this.message = "this index is a leader index; waiting for all following indices to cease following before proceeding";
}
Info() { }

String getMessage() {
return message;
Expand All @@ -86,10 +91,13 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Info info = (Info) o;
return Objects.equals(getMessage(), info.getMessage());
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
}

@Override
Expand Down

0 comments on commit 906da63

Please sign in to comment.