Skip to content

Commit 95aefce

Browse files
committed
Moving listener to last in the args list
1 parent f8f18da commit 95aefce

File tree

12 files changed

+31
-30
lines changed

12 files changed

+31
-30
lines changed

modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportDataStreamsStatsAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ protected void shardOperation(
115115
DataStreamsStatsAction.Request request,
116116
ShardRouting shardRouting,
117117
Task task,
118-
ActionListener<DataStreamsStatsAction.DataStreamShardStats> listener,
119-
Void nodeContext
118+
Void nodeContext,
119+
ActionListener<DataStreamsStatsAction.DataStreamShardStats> listener
120120
) {
121121
ActionListener.completeWith(listener, () -> {
122122
assert shardRouting.isSearchable() : "shard routing is not searchable: " + shardRouting;

server/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportReloadAnalyzersAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ protected void shardOperation(
123123
ReloadAnalyzersRequest request,
124124
ShardRouting shardRouting,
125125
Task task,
126-
ActionListener<ReloadResult> listener,
127-
Void nodeContext
126+
Void nodeContext,
127+
ActionListener<ReloadResult> listener
128128
) {
129129
ActionListener.completeWith(listener, () -> {
130130
logger.info("reloading analyzers for index shard " + shardRouting);

server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ protected void shardOperation(
9595
ClearIndicesCacheRequest request,
9696
ShardRouting shardRouting,
9797
Task task,
98-
ActionListener<EmptyResult> listener,
99-
Void nodeContext
98+
Void nodeContext,
99+
ActionListener<EmptyResult> listener
100100
) {
101101
ActionListener.completeWith(listener, () -> {
102102
indicesService.clearIndexShardCache(

server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/TransportForceMergeAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ protected void shardOperation(
9595
ForceMergeRequest request,
9696
ShardRouting shardRouting,
9797
Task task,
98-
ActionListener<TransportBroadcastByNodeAction.EmptyResult> listener,
99-
Void nodeContext
98+
Void nodeContext,
99+
ActionListener<EmptyResult> listener
100100
) {
101101
assert (task instanceof CancellableTask) == false; // TODO: add cancellation handling here once the task supports it
102102
SubscribableListener.<IndexShard>newForked(l -> {

server/src/main/java/org/elasticsearch/action/admin/indices/recovery/TransportRecoveryAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ protected void shardOperation(
107107
RecoveryRequest request,
108108
ShardRouting shardRouting,
109109
Task task,
110-
ActionListener<RecoveryState> listener,
111-
Void nodeContext
110+
Void nodeContext,
111+
ActionListener<RecoveryState> listener
112112
) {
113113
ActionListener.completeWith(listener, () -> {
114114
assert task instanceof CancellableTask;

server/src/main/java/org/elasticsearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ protected void shardOperation(
110110
IndicesSegmentsRequest request,
111111
ShardRouting shardRouting,
112112
Task task,
113-
ActionListener<ShardSegments> listener,
114-
Void nodeContext
113+
Void nodeContext,
114+
ActionListener<ShardSegments> listener
115115
) {
116116
ActionListener.completeWith(listener, () -> {
117117
assert task instanceof CancellableTask;

server/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportFieldUsageAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ protected void shardOperation(
9595
FieldUsageStatsRequest request,
9696
ShardRouting shardRouting,
9797
Task task,
98-
ActionListener<FieldUsageShardResponse> listener,
99-
Void nodeContext
98+
Void nodeContext,
99+
ActionListener<FieldUsageShardResponse> listener
100100
) {
101101
ActionListener.completeWith(listener, () -> {
102102
final ShardId shardId = shardRouting.shardId();

server/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportIndicesStatsAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ protected void shardOperation(
117117
IndicesStatsRequest request,
118118
ShardRouting shardRouting,
119119
Task task,
120-
ActionListener<ShardStats> listener,
121-
Void nodeContext
120+
Void nodeContext,
121+
ActionListener<ShardStats> listener
122122
) {
123123
ActionListener.completeWith(listener, () -> {
124124
assert task instanceof CancellableTask;

server/src/main/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ protected abstract void shardOperation(
185185
Request request,
186186
ShardRouting shardRouting,
187187
Task task,
188-
ActionListener<ShardOperationResult> listener,
189-
NodeContext nodeContext
188+
NodeContext nodeContext,
189+
ActionListener<ShardOperationResult> listener
190190
);
191191

192192
protected NodeContext createNodeContext() {
@@ -430,7 +430,7 @@ private void executeAsDataNode(
430430
@Override
431431
protected void sendItemRequest(ShardRouting shardRouting, ActionListener<ShardOperationResult> listener) {
432432
logger.trace(() -> format("[%s] executing operation for shard [%s]", actionName, shardRouting.shortSummary()));
433-
ActionRunnable.wrap(listener, l -> shardOperation(request, shardRouting, task, l, nodeContext)).run();
433+
ActionRunnable.wrap(listener, l -> shardOperation(request, shardRouting, task, nodeContext, l)).run();
434434
}
435435

436436
@Override
@@ -616,7 +616,8 @@ public void writeTo(StreamOutput out) throws IOException {
616616
}
617617

618618
/**
619-
* Can be used for implementations of {@link #shardOperation(BroadcastRequest, ShardRouting, Task, ActionListener, NodeContext) shardOperation} for
619+
* Can be used for implementations of
620+
* {@linkTransportBroadcastByNodeAction#shardOperation(BroadcastRequest, ShardRouting, Task, Object, ActionListener) shardOperation} for
620621
* which there is no shard-level return value.
621622
*/
622623
public static final class EmptyResult implements Writeable {

server/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ protected void shardOperation(
216216
Request request,
217217
ShardRouting shardRouting,
218218
Task task,
219-
ActionListener<ShardResult> listener,
220-
Integer nodeContext
219+
Integer nodeContext,
220+
ActionListener<ShardResult> listener
221221
) {
222222
assertThat(expectedNodeContext, not(nullValue()));
223223
assertThat(nodeContext, equalTo(expectedNodeContext));
@@ -666,8 +666,8 @@ protected void shardOperation(
666666
Request request,
667667
ShardRouting shardRouting,
668668
Task task,
669-
ActionListener<ShardResult> listener,
670-
Integer nodeContext
669+
Integer nodeContext,
670+
ActionListener<ShardResult> listener
671671
) {
672672
// this test runs a node-level operation on three shards, cancelling the task some time during the execution on the second
673673
if (task instanceof CancellableTask cancellableTask) {
@@ -726,8 +726,8 @@ protected void shardOperation(
726726
Request request,
727727
ShardRouting shardRouting,
728728
Task task,
729-
ActionListener<ShardResult> listener,
730-
Integer nodeContext
729+
Integer nodeContext,
730+
ActionListener<ShardResult> listener
731731
) {
732732
listeners.add(listener);
733733
}

0 commit comments

Comments
 (0)