Skip to content

Commit 3a15fe6

Browse files
committed
rename
1 parent 90fb198 commit 3a15fe6

File tree

2 files changed

+32
-33
lines changed

2 files changed

+32
-33
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/AutoFollowCoordinatorTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,18 +356,18 @@ public void testStats() {
356356
new AutoFollowCoordinator.AutoFollowResult("_alias1"))
357357
);
358358
AutoFollowStats autoFollowStats = autoFollowCoordinator.getStats();
359-
assertThat(autoFollowStats.getNumberOfFailedIndicesAutoFollowed(), equalTo(0L));
359+
assertThat(autoFollowStats.getNumberOfFailedFollowIndices(), equalTo(0L));
360360
assertThat(autoFollowStats.getNumberOfFailedRemoteClusterStateRequests(), equalTo(0L));
361-
assertThat(autoFollowStats.getNumberOfSuccessfulIndicesAutoFollowed(), equalTo(0L));
361+
assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo(0L));
362362
assertThat(autoFollowStats.getRecentAutoFollowErrors().size(), equalTo(0));
363363

364364
autoFollowCoordinator.updateStats(Collections.singletonList(
365365
new AutoFollowCoordinator.AutoFollowResult("_alias1", new RuntimeException("error")))
366366
);
367367
autoFollowStats = autoFollowCoordinator.getStats();
368-
assertThat(autoFollowStats.getNumberOfFailedIndicesAutoFollowed(), equalTo(0L));
368+
assertThat(autoFollowStats.getNumberOfFailedFollowIndices(), equalTo(0L));
369369
assertThat(autoFollowStats.getNumberOfFailedRemoteClusterStateRequests(), equalTo(1L));
370-
assertThat(autoFollowStats.getNumberOfSuccessfulIndicesAutoFollowed(), equalTo(0L));
370+
assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo(0L));
371371
assertThat(autoFollowStats.getRecentAutoFollowErrors().size(), equalTo(1));
372372
assertThat(autoFollowStats.getRecentAutoFollowErrors().get("_alias1").getCause().getMessage(), equalTo("error"));
373373

@@ -378,9 +378,9 @@ public void testStats() {
378378
Collections.singletonList(Tuple.tuple(new Index("index2", "_na_"), new RuntimeException("error"))))
379379
));
380380
autoFollowStats = autoFollowCoordinator.getStats();
381-
assertThat(autoFollowStats.getNumberOfFailedIndicesAutoFollowed(), equalTo(2L));
381+
assertThat(autoFollowStats.getNumberOfFailedFollowIndices(), equalTo(2L));
382382
assertThat(autoFollowStats.getNumberOfFailedRemoteClusterStateRequests(), equalTo(1L));
383-
assertThat(autoFollowStats.getNumberOfSuccessfulIndicesAutoFollowed(), equalTo(0L));
383+
assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo(0L));
384384
assertThat(autoFollowStats.getRecentAutoFollowErrors().size(), equalTo(3));
385385
assertThat(autoFollowStats.getRecentAutoFollowErrors().get("_alias1").getCause().getMessage(), equalTo("error"));
386386
assertThat(autoFollowStats.getRecentAutoFollowErrors().get("_alias1:index1").getCause().getMessage(), equalTo("error"));
@@ -393,9 +393,9 @@ public void testStats() {
393393
Collections.singletonList(Tuple.tuple(new Index("index2", "_na_"), null)))
394394
));
395395
autoFollowStats = autoFollowCoordinator.getStats();
396-
assertThat(autoFollowStats.getNumberOfFailedIndicesAutoFollowed(), equalTo(2L));
396+
assertThat(autoFollowStats.getNumberOfFailedFollowIndices(), equalTo(2L));
397397
assertThat(autoFollowStats.getNumberOfFailedRemoteClusterStateRequests(), equalTo(1L));
398-
assertThat(autoFollowStats.getNumberOfSuccessfulIndicesAutoFollowed(), equalTo(2L));
398+
assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo(2L));
399399
assertThat(autoFollowStats.getRecentAutoFollowErrors().size(), equalTo(3));
400400
assertThat(autoFollowStats.getRecentAutoFollowErrors().get("_alias1").getCause().getMessage(), equalTo("error"));
401401
assertThat(autoFollowStats.getRecentAutoFollowErrors().get("_alias1:index1").getCause().getMessage(), equalTo("error"));

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowStats.java

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626

2727
public class AutoFollowStats implements Writeable, ToXContentObject {
2828

29-
private static final ParseField NUMBER_OF_SUCCESSFUL_INDICES_AUTO_FOLLOWED =
30-
new ParseField("number_of_successful_indices_auto_followed");
31-
private static final ParseField NUMBER_OF_FAILED_INDICES_AUTO_FOLLOWED = new ParseField("number_of_failed_indices_auto_followed");
29+
private static final ParseField NUMBER_OF_SUCCESSFUL_INDICES_AUTO_FOLLOWED = new ParseField("number_of_successful_follow_indices");
30+
private static final ParseField NUMBER_OF_FAILED_INDICES_AUTO_FOLLOWED = new ParseField("number_of_failed_follow_indices");
3231
private static final ParseField NUMBER_OF_FAILED_REMOTE_CLUSTER_STATE_REQUESTS =
3332
new ParseField("number_of_failed_remote_cluster_state_requests");
3433
private static final ParseField RECENT_AUTO_FOLLOW_ERRORS = new ParseField("recent_auto_follow_errors");
@@ -70,48 +69,48 @@ public static AutoFollowStats fromXContent(final XContentParser parser) {
7069
return STATS_PARSER.apply(parser, null);
7170
}
7271

73-
private final long numberOfFailedIndicesAutoFollowed;
72+
private final long numberOfFailedFollowIndices;
7473
private final long numberOfFailedRemoteClusterStateRequests;
75-
private final long numberOfSuccessfulIndicesAutoFollowed;
74+
private final long numberOfSuccessfulFollowIndices;
7675
private final NavigableMap<String, ElasticsearchException> recentAutoFollowErrors;
7776

7877
public AutoFollowStats(
79-
long numberOfFailedIndicesAutoFollowed,
78+
long numberOfFailedFollowIndices,
8079
long numberOfFailedRemoteClusterStateRequests,
81-
long numberOfSuccessfulIndicesAutoFollowed,
80+
long numberOfSuccessfulFollowIndices,
8281
NavigableMap<String, ElasticsearchException> recentAutoFollowErrors
8382
) {
84-
this.numberOfFailedIndicesAutoFollowed = numberOfFailedIndicesAutoFollowed;
83+
this.numberOfFailedFollowIndices = numberOfFailedFollowIndices;
8584
this.numberOfFailedRemoteClusterStateRequests = numberOfFailedRemoteClusterStateRequests;
86-
this.numberOfSuccessfulIndicesAutoFollowed = numberOfSuccessfulIndicesAutoFollowed;
85+
this.numberOfSuccessfulFollowIndices = numberOfSuccessfulFollowIndices;
8786
this.recentAutoFollowErrors = recentAutoFollowErrors;
8887
}
8988

9089
public AutoFollowStats(StreamInput in) throws IOException {
91-
numberOfFailedIndicesAutoFollowed = in.readVLong();
90+
numberOfFailedFollowIndices = in.readVLong();
9291
numberOfFailedRemoteClusterStateRequests = in.readVLong();
93-
numberOfSuccessfulIndicesAutoFollowed = in.readVLong();
92+
numberOfSuccessfulFollowIndices = in.readVLong();
9493
recentAutoFollowErrors= new TreeMap<>(in.readMap(StreamInput::readString, StreamInput::readException));
9594
}
9695

9796
@Override
9897
public void writeTo(StreamOutput out) throws IOException {
99-
out.writeVLong(numberOfFailedIndicesAutoFollowed);
98+
out.writeVLong(numberOfFailedFollowIndices);
10099
out.writeVLong(numberOfFailedRemoteClusterStateRequests);
101-
out.writeVLong(numberOfSuccessfulIndicesAutoFollowed);
100+
out.writeVLong(numberOfSuccessfulFollowIndices);
102101
out.writeMap(recentAutoFollowErrors, StreamOutput::writeString, StreamOutput::writeException);
103102
}
104103

105-
public long getNumberOfFailedIndicesAutoFollowed() {
106-
return numberOfFailedIndicesAutoFollowed;
104+
public long getNumberOfFailedFollowIndices() {
105+
return numberOfFailedFollowIndices;
107106
}
108107

109108
public long getNumberOfFailedRemoteClusterStateRequests() {
110109
return numberOfFailedRemoteClusterStateRequests;
111110
}
112111

113-
public long getNumberOfSuccessfulIndicesAutoFollowed() {
114-
return numberOfSuccessfulIndicesAutoFollowed;
112+
public long getNumberOfSuccessfulFollowIndices() {
113+
return numberOfSuccessfulFollowIndices;
115114
}
116115

117116
public NavigableMap<String, ElasticsearchException> getRecentAutoFollowErrors() {
@@ -122,9 +121,9 @@ public NavigableMap<String, ElasticsearchException> getRecentAutoFollowErrors()
122121
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
123122
builder.startObject();
124123
{
125-
builder.field(NUMBER_OF_FAILED_INDICES_AUTO_FOLLOWED.getPreferredName(), numberOfFailedIndicesAutoFollowed);
124+
builder.field(NUMBER_OF_FAILED_INDICES_AUTO_FOLLOWED.getPreferredName(), numberOfFailedFollowIndices);
126125
builder.field(NUMBER_OF_FAILED_REMOTE_CLUSTER_STATE_REQUESTS.getPreferredName(), numberOfFailedRemoteClusterStateRequests);
127-
builder.field(NUMBER_OF_SUCCESSFUL_INDICES_AUTO_FOLLOWED.getPreferredName(), numberOfSuccessfulIndicesAutoFollowed);
126+
builder.field(NUMBER_OF_SUCCESSFUL_INDICES_AUTO_FOLLOWED.getPreferredName(), numberOfSuccessfulFollowIndices);
128127
builder.startArray(RECENT_AUTO_FOLLOW_ERRORS.getPreferredName());
129128
{
130129
for (final Map.Entry<String, ElasticsearchException> entry : recentAutoFollowErrors.entrySet()) {
@@ -152,9 +151,9 @@ public boolean equals(Object o) {
152151
if (this == o) return true;
153152
if (o == null || getClass() != o.getClass()) return false;
154153
AutoFollowStats that = (AutoFollowStats) o;
155-
return numberOfFailedIndicesAutoFollowed == that.numberOfFailedIndicesAutoFollowed &&
154+
return numberOfFailedFollowIndices == that.numberOfFailedFollowIndices &&
156155
numberOfFailedRemoteClusterStateRequests == that.numberOfFailedRemoteClusterStateRequests &&
157-
numberOfSuccessfulIndicesAutoFollowed == that.numberOfSuccessfulIndicesAutoFollowed &&
156+
numberOfSuccessfulFollowIndices == that.numberOfSuccessfulFollowIndices &&
158157
/*
159158
* ElasticsearchException does not implement equals so we will assume the fetch exceptions are equal if they are equal
160159
* up to the key set and their messages. Note that we are relying on the fact that the auto follow exceptions are ordered by
@@ -167,9 +166,9 @@ public boolean equals(Object o) {
167166
@Override
168167
public int hashCode() {
169168
return Objects.hash(
170-
numberOfFailedIndicesAutoFollowed,
169+
numberOfFailedFollowIndices,
171170
numberOfFailedRemoteClusterStateRequests,
172-
numberOfSuccessfulIndicesAutoFollowed,
171+
numberOfSuccessfulFollowIndices,
173172
/*
174173
* ElasticsearchException does not implement hash code so we will compute the hash code based on the key set and the
175174
* messages. Note that we are relying on the fact that the auto follow exceptions are ordered by keys.
@@ -186,9 +185,9 @@ private static List<String> getFetchExceptionMessages(final AutoFollowStats stat
186185
@Override
187186
public String toString() {
188187
return "AutoFollowStats{" +
189-
"numberOfFailedIndicesAutoFollowed=" + numberOfFailedIndicesAutoFollowed +
188+
"numberOfFailedFollowIndices=" + numberOfFailedFollowIndices +
190189
", numberOfFailedRemoteClusterStateRequests=" + numberOfFailedRemoteClusterStateRequests +
191-
", numberOfSuccessfulIndicesAutoFollowed=" + numberOfSuccessfulIndicesAutoFollowed +
190+
", numberOfSuccessfulFollowIndices=" + numberOfSuccessfulFollowIndices +
192191
", recentAutoFollowErrors=" + recentAutoFollowErrors +
193192
'}';
194193
}

0 commit comments

Comments
 (0)