Skip to content

Commit 906da63

Browse files
committed
Review feedback
1 parent 1de1466 commit 906da63

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/WaitForNoFollowersStep.java

+16-8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
import java.util.Arrays;
2323
import java.util.Objects;
2424

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

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

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

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

71-
Info() {
72-
this.message = "this index is a leader index; waiting for all following indices to cease following before proceeding";
73-
}
78+
Info() { }
7479

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

8792
@Override
8893
public boolean equals(Object o) {
89-
if (this == o) return true;
90-
if (o == null || getClass() != o.getClass()) return false;
91-
Info info = (Info) o;
92-
return Objects.equals(getMessage(), info.getMessage());
94+
if (this == o) {
95+
return true;
96+
}
97+
if (o == null || getClass() != o.getClass()) {
98+
return false;
99+
}
100+
return true;
93101
}
94102

95103
@Override

0 commit comments

Comments
 (0)