Skip to content

Commit fdb2ac2

Browse files
authored
add description to shard changes action request (#80275) (#80333)
1 parent c4693bb commit fdb2ac2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardChangesAction.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ public void writeTo(StreamOutput out) throws IOException {
169169
maxBatchSize.writeTo(out);
170170
}
171171

172+
@Override
173+
public String getDescription() {
174+
return "shardId[" + shardId + "]";
175+
}
176+
172177
@Override
173178
public boolean equals(final Object o) {
174179
if (this == o) return true;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,12 @@ public void onFailure(final Exception e) {
267267
assertThat(reference.get(), instanceOf(ShardNotFoundException.class));
268268
}
269269

270+
public void testShardChangesActionRequestHasDescription() {
271+
var index = new Index("index", "uuid");
272+
var shardId = new ShardId(index, 0);
273+
274+
var description = new ShardChangesAction.Request(shardId, "uuid").getDescription();
275+
276+
assertThat(description, equalTo("shardId[[index][0]]"));
277+
}
270278
}

0 commit comments

Comments
 (0)