Skip to content

Commit 32af366

Browse files
javannasmalyshev
authored andcommitted
Remove request arg from TransportSingleShardAction#getExecutor method (elastic#124872)
The argument is not used anywhere and can be removed.
1 parent 523bf29 commit 32af366

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

server/src/main/java/org/elasticsearch/action/get/TransportGetAction.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,18 @@ protected Writeable.Reader<GetResponse> getResponseReader() {
167167
}
168168

169169
@Override
170-
protected Executor getExecutor(GetRequest request, ShardId shardId) {
170+
protected Executor getExecutor(ShardId shardId) {
171171
final ClusterState clusterState = clusterService.state();
172172
if (projectResolver.getProjectMetadata(clusterState).getIndexSafe(shardId.getIndex()).isSystem()) {
173173
return threadPool.executor(executorSelector.executorForGet(shardId.getIndexName()));
174174
} else {
175-
return super.getExecutor(request, shardId);
175+
return super.getExecutor(shardId);
176176
}
177177
}
178178

179179
private void asyncGet(GetRequest request, ShardId shardId, ActionListener<GetResponse> listener) throws IOException {
180180
if (request.refresh() && request.realtime() == false) {
181-
getExecutor(request, shardId).execute(ActionRunnable.wrap(listener, l -> {
181+
getExecutor(shardId).execute(ActionRunnable.wrap(listener, l -> {
182182
var indexShard = getIndexShard(shardId);
183183
indexShard.externalRefresh("refresh_flag_get", l.map(r -> shardOperation(request, shardId)));
184184
}));
@@ -300,7 +300,7 @@ private void tryGetFromTranslog(GetRequest request, IndexShard indexShard, Disco
300300
indexShard.waitForPrimaryTermAndGeneration(r.primaryTerm(), r.segmentGeneration(), termAndGenerationListener);
301301
}
302302
}
303-
}), TransportGetFromTranslogAction.Response::new, getExecutor(request, shardId))
303+
}), TransportGetFromTranslogAction.Response::new, getExecutor(shardId))
304304
);
305305
}
306306

server/src/main/java/org/elasticsearch/action/get/TransportShardMultiGetAction.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ protected MultiGetShardResponse shardOperation(MultiGetShardRequest request, Sha
156156
}
157157

158158
@Override
159-
protected Executor getExecutor(MultiGetShardRequest request, ShardId shardId) {
159+
protected Executor getExecutor(ShardId shardId) {
160160
final ClusterState clusterState = clusterService.state();
161161
if (projectResolver.getProjectMetadata(clusterState).index(shardId.getIndex()).isSystem()) {
162162
return threadPool.executor(executorSelector.executorForGet(shardId.getIndexName()));
163163
} else {
164-
return super.getExecutor(request, shardId);
164+
return super.getExecutor(shardId);
165165
}
166166
}
167167

@@ -290,7 +290,7 @@ private void tryShardMultiGetFromTranslog(
290290
assert r.primaryTerm() > Engine.UNKNOWN_PRIMARY_TERM;
291291
final ActionListener<Long> termAndGenerationListener = ContextPreservingActionListener.wrapPreservingContext(
292292
listener.delegateFailureAndWrap(
293-
(ll, aLong) -> getExecutor(request, shardId).execute(
293+
(ll, aLong) -> getExecutor(shardId).execute(
294294
ActionRunnable.supply(ll, () -> handleLocalGets(request, r.multiGetShardResponse(), shardId))
295295
)
296296
),
@@ -299,7 +299,7 @@ private void tryShardMultiGetFromTranslog(
299299
indexShard.waitForPrimaryTermAndGeneration(r.primaryTerm(), r.segmentGeneration(), termAndGenerationListener);
300300
}
301301
}
302-
}), TransportShardMultiGetFomTranslogAction.Response::new, getExecutor(request, shardId))
302+
}), TransportShardMultiGetFomTranslogAction.Response::new, getExecutor(shardId))
303303
);
304304
}
305305

@@ -353,7 +353,7 @@ private void getAndAddToResponse(
353353
private void asyncShardMultiGet(MultiGetShardRequest request, ShardId shardId, ActionListener<MultiGetShardResponse> listener)
354354
throws IOException {
355355
if (request.refresh() && request.realtime() == false) {
356-
getExecutor(request, shardId).execute(ActionRunnable.wrap(listener, l -> {
356+
getExecutor(shardId).execute(ActionRunnable.wrap(listener, l -> {
357357
var indexShard = getIndexShard(shardId);
358358
indexShard.externalRefresh("refresh_flag_mget", l.map(r -> shardOperation(request, shardId)));
359359
}));

server/src/main/java/org/elasticsearch/action/support/single/shard/TransportSingleShardAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected void doExecute(Task task, Request request, ActionListener<Response> li
114114
protected abstract Response shardOperation(Request request, ShardId shardId) throws IOException;
115115

116116
protected void asyncShardOperation(Request request, ShardId shardId, ActionListener<Response> listener) throws IOException {
117-
getExecutor(request, shardId).execute(ActionRunnable.supplyAndDecRef(listener, () -> shardOperation(request, shardId)));
117+
getExecutor(shardId).execute(ActionRunnable.supplyAndDecRef(listener, () -> shardOperation(request, shardId)));
118118
}
119119

120120
protected abstract Writeable.Reader<Response> getResponseReader();
@@ -300,7 +300,7 @@ public String concreteIndex() {
300300
}
301301
}
302302

303-
protected Executor getExecutor(Request request, ShardId shardId) {
303+
protected Executor getExecutor(ShardId shardId) {
304304
return executor;
305305
}
306306
}

0 commit comments

Comments
 (0)