Bläddra i källkod

Replace `TransportResponse.Empty` with `ActionResponse.Empty` (#126400)

No need to distinguish these things any more, we can just use
`ActionResponse.Empty` everywhere.
David Turner 6 månader sedan
förälder
incheckning
cedcb5ccfe
31 ändrade filer med 142 tillägg och 150 borttagningar
  1. 3 2
      server/src/internalClusterTest/java/org/elasticsearch/common/network/ThreadWatchdogIT.java
  2. 4 3
      server/src/main/java/org/elasticsearch/action/search/SearchTransportService.java
  3. 3 3
      server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java
  4. 1 1
      server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java
  5. 1 1
      server/src/main/java/org/elasticsearch/cluster/coordination/FollowersChecker.java
  6. 1 1
      server/src/main/java/org/elasticsearch/cluster/coordination/JoinHelper.java
  7. 3 3
      server/src/main/java/org/elasticsearch/cluster/coordination/JoinValidationService.java
  8. 1 1
      server/src/main/java/org/elasticsearch/cluster/coordination/LeaderChecker.java
  9. 2 2
      server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java
  10. 11 10
      server/src/main/java/org/elasticsearch/indices/recovery/RemoteRecoveryTargetHandler.java
  11. 4 4
      server/src/main/java/org/elasticsearch/tasks/TaskCancellationService.java
  12. 1 20
      server/src/main/java/org/elasticsearch/transport/TransportResponse.java
  13. 6 5
      server/src/main/java/org/elasticsearch/transport/TransportResponseHandler.java
  14. 2 2
      server/src/test/java/org/elasticsearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java
  15. 2 1
      server/src/test/java/org/elasticsearch/action/search/ClearScrollControllerTests.java
  16. 10 10
      server/src/test/java/org/elasticsearch/action/support/replication/TransportWriteActionTests.java
  17. 8 8
      server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStateActionTests.java
  18. 3 3
      server/src/test/java/org/elasticsearch/cluster/coordination/FollowersCheckerTests.java
  19. 2 2
      server/src/test/java/org/elasticsearch/cluster/coordination/JoinHelperTests.java
  20. 7 6
      server/src/test/java/org/elasticsearch/cluster/coordination/JoinValidationServiceTests.java
  21. 6 6
      server/src/test/java/org/elasticsearch/cluster/coordination/LeaderCheckerTests.java
  22. 2 1
      server/src/test/java/org/elasticsearch/cluster/coordination/NodeJoinTests.java
  23. 5 5
      server/src/test/java/org/elasticsearch/rest/action/RestBuilderListenerTests.java
  24. 2 1
      server/src/test/java/org/elasticsearch/transport/TaskTransportChannelTests.java
  25. 8 7
      server/src/test/java/org/elasticsearch/transport/TransportServiceDeserializationFailureTests.java
  26. 11 10
      server/src/test/java/org/elasticsearch/transport/TransportServiceLifecycleTests.java
  27. 24 23
      test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java
  28. 3 3
      x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/DriverTaskRunner.java
  29. 3 3
      x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/exchange/ExchangeService.java
  30. 1 1
      x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportInterceptorTests.java
  31. 2 2
      x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SecurityNetty4HeaderSizeLimitTests.java

+ 3 - 2
server/src/internalClusterTest/java/org/elasticsearch/common/network/ThreadWatchdogIT.java

@@ -11,6 +11,7 @@ package org.elasticsearch.common.network;
 
 import org.apache.logging.log4j.Level;
 import org.elasticsearch.action.ActionListenerResponseHandler;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.support.SubscribableListener;
 import org.elasticsearch.client.Request;
 import org.elasticsearch.client.internal.node.NodeClient;
@@ -137,7 +138,7 @@ public class ThreadWatchdogIT extends ESIntegTestCase {
             EmptyRequest::new,
             (request, channel, task) -> {
                 blockAndWaitForWatchdogLogs();
-                channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                channel.sendResponse(ActionResponse.Empty.INSTANCE);
             }
         );
 
@@ -149,7 +150,7 @@ public class ThreadWatchdogIT extends ESIntegTestCase {
                     new EmptyRequest(),
                     new ActionListenerResponseHandler<TransportResponse>(
                         l,
-                        in -> TransportResponse.Empty.INSTANCE,
+                        in -> ActionResponse.Empty.INSTANCE,
                         EsExecutors.DIRECT_EXECUTOR_SERVICE
                     )
                 )

+ 4 - 3
server/src/main/java/org/elasticsearch/action/search/SearchTransportService.java

@@ -13,6 +13,7 @@ import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.elasticsearch.action.ActionListener;
 import org.elasticsearch.action.ActionListenerResponseHandler;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.OriginalIndices;
 import org.elasticsearch.action.admin.cluster.node.tasks.cancel.CancelTasksRequest;
 import org.elasticsearch.action.admin.cluster.node.tasks.get.TransportGetTaskAction;
@@ -161,7 +162,7 @@ public class SearchTransportService {
             CLEAR_SCROLL_CONTEXTS_ACTION_NAME,
             new ClearScrollContextsRequest(),
             TransportRequestOptions.EMPTY,
-            new ActionListenerResponseHandler<>(listener, in -> TransportResponse.Empty.INSTANCE, TransportResponseHandler.TRANSPORT_WORKER)
+            new ActionListenerResponseHandler<>(listener, in -> ActionResponse.Empty.INSTANCE, TransportResponseHandler.TRANSPORT_WORKER)
         );
     }
 
@@ -418,14 +419,14 @@ public class SearchTransportService {
             ClearScrollContextsRequest::new,
             (request, channel, task) -> {
                 searchService.freeAllScrollContexts();
-                channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                channel.sendResponse(ActionResponse.Empty.INSTANCE);
             }
         );
         TransportActionProxy.registerProxyAction(
             transportService,
             CLEAR_SCROLL_CONTEXTS_ACTION_NAME,
             false,
-            (in) -> TransportResponse.Empty.INSTANCE
+            (in) -> ActionResponse.Empty.INSTANCE
         );
 
         transportService.registerRequestHandler(

+ 3 - 3
server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java

@@ -16,6 +16,7 @@ import org.elasticsearch.ExceptionsHelper;
 import org.elasticsearch.TransportVersion;
 import org.elasticsearch.TransportVersions;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.ResultDeduplicator;
 import org.elasticsearch.action.support.ChannelActionListener;
 import org.elasticsearch.cluster.ClusterState;
@@ -57,7 +58,6 @@ import org.elasticsearch.transport.RemoteTransportException;
 import org.elasticsearch.transport.TransportChannel;
 import org.elasticsearch.transport.TransportRequest;
 import org.elasticsearch.transport.TransportRequestHandler;
-import org.elasticsearch.transport.TransportResponse;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 
@@ -291,7 +291,7 @@ public class ShardStateAction {
             logger.debug(() -> format("%s received shard failed for [%s]", request.getShardId(), request), request.failure);
             taskQueue.submitTask(
                 "shard-failed " + request.toStringNoFailureStackTrace(),
-                new FailedShardUpdateTask(request, new ChannelActionListener<>(channel).map(ignored -> TransportResponse.Empty.INSTANCE)),
+                new FailedShardUpdateTask(request, new ChannelActionListener<>(channel).map(ignored -> ActionResponse.Empty.INSTANCE)),
                 null
             );
         }
@@ -602,7 +602,7 @@ public class ShardStateAction {
             logger.debug("{} received shard started for [{}]", request.shardId, request);
             taskQueue.submitTask(
                 "shard-started " + request,
-                new StartedShardUpdateTask(request, new ChannelActionListener<>(channel).map(ignored -> TransportResponse.Empty.INSTANCE)),
+                new StartedShardUpdateTask(request, new ChannelActionListener<>(channel).map(ignored -> ActionResponse.Empty.INSTANCE)),
                 null
             );
         }

+ 1 - 1
server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java

@@ -13,6 +13,7 @@ import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.lucene.util.SetOnce;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse.Empty;
 import org.elasticsearch.action.support.ChannelActionListener;
 import org.elasticsearch.action.support.RefCountingListener;
 import org.elasticsearch.action.support.SubscribableListener;
@@ -77,7 +78,6 @@ import org.elasticsearch.threadpool.ThreadPool;
 import org.elasticsearch.threadpool.ThreadPool.Names;
 import org.elasticsearch.transport.NodeDisconnectedException;
 import org.elasticsearch.transport.TransportRequestOptions;
-import org.elasticsearch.transport.TransportResponse.Empty;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 import org.elasticsearch.transport.Transports;

+ 1 - 1
server/src/main/java/org/elasticsearch/cluster/coordination/FollowersChecker.java

@@ -12,6 +12,7 @@ package org.elasticsearch.cluster.coordination;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse.Empty;
 import org.elasticsearch.action.ActionRunnable;
 import org.elasticsearch.action.support.ChannelActionListener;
 import org.elasticsearch.cluster.coordination.Coordinator.Mode;
@@ -37,7 +38,6 @@ import org.elasticsearch.transport.TransportException;
 import org.elasticsearch.transport.TransportRequest;
 import org.elasticsearch.transport.TransportRequestOptions;
 import org.elasticsearch.transport.TransportRequestOptions.Type;
-import org.elasticsearch.transport.TransportResponse.Empty;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 

+ 1 - 1
server/src/main/java/org/elasticsearch/cluster/coordination/JoinHelper.java

@@ -13,6 +13,7 @@ import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.elasticsearch.ElasticsearchException;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse.Empty;
 import org.elasticsearch.action.support.ChannelActionListener;
 import org.elasticsearch.cluster.ClusterState;
 import org.elasticsearch.cluster.coordination.Coordinator.Mode;
@@ -45,7 +46,6 @@ import org.elasticsearch.transport.ConnectTransportException;
 import org.elasticsearch.transport.TransportException;
 import org.elasticsearch.transport.TransportRequest;
 import org.elasticsearch.transport.TransportRequestOptions;
-import org.elasticsearch.transport.TransportResponse.Empty;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 

+ 3 - 3
server/src/main/java/org/elasticsearch/cluster/coordination/JoinValidationService.java

@@ -14,6 +14,7 @@ import org.apache.logging.log4j.Logger;
 import org.elasticsearch.ElasticsearchException;
 import org.elasticsearch.TransportVersion;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.ActionRunnable;
 import org.elasticsearch.cluster.ClusterState;
 import org.elasticsearch.cluster.metadata.Metadata;
@@ -39,7 +40,6 @@ import org.elasticsearch.transport.BytesTransportRequest;
 import org.elasticsearch.transport.NodeNotConnectedException;
 import org.elasticsearch.transport.Transport;
 import org.elasticsearch.transport.TransportRequestOptions;
-import org.elasticsearch.transport.TransportResponse;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 
@@ -143,7 +143,7 @@ public class JoinValidationService {
                     );
                 }
                 joinValidators.forEach(joinValidator -> joinValidator.accept(transportService.getLocalNode(), remoteState));
-                channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                channel.sendResponse(ActionResponse.Empty.INSTANCE);
             }
         );
     }
@@ -343,7 +343,7 @@ public class JoinValidationService {
                 REQUEST_OPTIONS,
                 new CleanableResponseHandler<>(
                     listener.map(ignored -> null),
-                    in -> TransportResponse.Empty.INSTANCE,
+                    in -> ActionResponse.Empty.INSTANCE,
                     responseExecutor,
                     bytes::decRef
                 )

+ 1 - 1
server/src/main/java/org/elasticsearch/cluster/coordination/LeaderChecker.java

@@ -12,6 +12,7 @@ package org.elasticsearch.cluster.coordination;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.elasticsearch.ExceptionsHelper;
+import org.elasticsearch.action.ActionResponse.Empty;
 import org.elasticsearch.cluster.node.DiscoveryNode;
 import org.elasticsearch.cluster.node.DiscoveryNodes;
 import org.elasticsearch.common.io.stream.StreamInput;
@@ -36,7 +37,6 @@ import org.elasticsearch.transport.TransportException;
 import org.elasticsearch.transport.TransportRequest;
 import org.elasticsearch.transport.TransportRequestOptions;
 import org.elasticsearch.transport.TransportRequestOptions.Type;
-import org.elasticsearch.transport.TransportResponse.Empty;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 

+ 2 - 2
server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java

@@ -565,7 +565,7 @@ public class PeerRecoveryTargetService implements IndexEventListener {
                     .handoffPrimaryContext(
                         request.primaryContext(),
                         ActionListener.runBefore(
-                            new ChannelActionListener<>(channel).map(v -> TransportResponse.Empty.INSTANCE),
+                            new ChannelActionListener<>(channel).map(v -> ActionResponse.Empty.INSTANCE),
                             recoveryRef::close
                         )
                     );
@@ -688,7 +688,7 @@ public class PeerRecoveryTargetService implements IndexEventListener {
         }
 
         protected CheckedFunction<Void, TransportResponse, Exception> responseMapping(RecoveryTarget recoveryTarget) {
-            return v -> TransportResponse.Empty.INSTANCE;
+            return v -> ActionResponse.Empty.INSTANCE;
         }
 
         protected abstract void handleRequest(T request, RecoveryTarget target, ActionListener<Void> listener) throws IOException;

+ 11 - 10
server/src/main/java/org/elasticsearch/indices/recovery/RemoteRecoveryTargetHandler.java

@@ -17,6 +17,7 @@ import org.elasticsearch.ElasticsearchException;
 import org.elasticsearch.ExceptionsHelper;
 import org.elasticsearch.action.ActionListener;
 import org.elasticsearch.action.ActionListenerResponseHandler;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.ActionRunnable;
 import org.elasticsearch.action.support.RetryableAction;
 import org.elasticsearch.cluster.node.DiscoveryNode;
@@ -116,7 +117,7 @@ public class RemoteRecoveryTargetHandler implements RecoveryTargetHandler {
             shardId,
             totalTranslogOps
         );
-        final Writeable.Reader<TransportResponse.Empty> reader = in -> TransportResponse.Empty.INSTANCE;
+        final Writeable.Reader<ActionResponse.Empty> reader = in -> ActionResponse.Empty.INSTANCE;
         executeRetryableAction(action, request, standardTimeoutRequestOptions, listener.map(r -> null), reader);
     }
 
@@ -131,7 +132,7 @@ public class RemoteRecoveryTargetHandler implements RecoveryTargetHandler {
             globalCheckpoint,
             trimAboveSeqNo
         );
-        final Writeable.Reader<TransportResponse.Empty> reader = in -> TransportResponse.Empty.INSTANCE;
+        final Writeable.Reader<ActionResponse.Empty> reader = in -> ActionResponse.Empty.INSTANCE;
         executeRetryableAction(
             action,
             request,
@@ -148,7 +149,7 @@ public class RemoteRecoveryTargetHandler implements RecoveryTargetHandler {
             PeerRecoveryTargetService.Actions.HANDOFF_PRIMARY_CONTEXT,
             new RecoveryHandoffPrimaryContextRequest(recoveryId, shardId, primaryContext),
             standardTimeoutRequestOptions,
-            new ActionListenerResponseHandler<>(listener.map(r -> null), in -> TransportResponse.Empty.INSTANCE, threadPool.generic())
+            new ActionListenerResponseHandler<>(listener.map(r -> null), in -> ActionResponse.Empty.INSTANCE, threadPool.generic())
         );
     }
 
@@ -200,7 +201,7 @@ public class RemoteRecoveryTargetHandler implements RecoveryTargetHandler {
             phase1ExistingFileSizes,
             totalTranslogOps
         );
-        final Writeable.Reader<TransportResponse.Empty> reader = in -> TransportResponse.Empty.INSTANCE;
+        final Writeable.Reader<ActionResponse.Empty> reader = in -> ActionResponse.Empty.INSTANCE;
         executeRetryableAction(action, request, standardTimeoutRequestOptions, listener.map(r -> null), reader);
     }
 
@@ -221,8 +222,8 @@ public class RemoteRecoveryTargetHandler implements RecoveryTargetHandler {
             totalTranslogOps,
             globalCheckpoint
         );
-        final Writeable.Reader<TransportResponse.Empty> reader = in -> TransportResponse.Empty.INSTANCE;
-        final ActionListener<TransportResponse.Empty> responseListener = listener.map(r -> null);
+        final Writeable.Reader<ActionResponse.Empty> reader = in -> ActionResponse.Empty.INSTANCE;
+        final ActionListener<ActionResponse.Empty> responseListener = listener.map(r -> null);
         executeRetryableAction(action, request, TransportRequestOptions.EMPTY, responseListener, reader);
     }
 
@@ -243,8 +244,8 @@ public class RemoteRecoveryTargetHandler implements RecoveryTargetHandler {
             indexId,
             snapshotFile
         );
-        final Writeable.Reader<TransportResponse.Empty> reader = in -> TransportResponse.Empty.INSTANCE;
-        final ActionListener<TransportResponse.Empty> responseListener = listener.map(r -> null);
+        final Writeable.Reader<ActionResponse.Empty> reader = in -> ActionResponse.Empty.INSTANCE;
+        final ActionListener<ActionResponse.Empty> responseListener = listener.map(r -> null);
         executeRetryableAction(action, request, TransportRequestOptions.EMPTY, responseListener, reader);
     }
 
@@ -303,8 +304,8 @@ public class RemoteRecoveryTargetHandler implements RecoveryTargetHandler {
         threadPool.generic()
             .execute(
                 ActionRunnable.wrap(
-                    ActionListener.<TransportResponse.Empty>runBefore(listener.map(r -> null), request::decRef),
-                    l -> executeRetryableAction(action, request, fileChunkRequestOptions, l, in -> TransportResponse.Empty.INSTANCE)
+                    ActionListener.<ActionResponse.Empty>runBefore(listener.map(r -> null), request::decRef),
+                    l -> executeRetryableAction(action, request, fileChunkRequestOptions, l, in -> ActionResponse.Empty.INSTANCE)
                 )
             );
     }

+ 4 - 4
server/src/main/java/org/elasticsearch/tasks/TaskCancellationService.java

@@ -16,6 +16,7 @@ import org.elasticsearch.ExceptionsHelper;
 import org.elasticsearch.TransportVersion;
 import org.elasticsearch.TransportVersions;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.ResultDeduplicator;
 import org.elasticsearch.action.support.ChannelActionListener;
 import org.elasticsearch.action.support.CountDownActionListener;
@@ -34,7 +35,6 @@ import org.elasticsearch.transport.TransportException;
 import org.elasticsearch.transport.TransportRequest;
 import org.elasticsearch.transport.TransportRequestHandler;
 import org.elasticsearch.transport.TransportRequestOptions;
-import org.elasticsearch.transport.TransportResponse;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 
@@ -361,7 +361,7 @@ public class TaskCancellationService {
                 final List<CancellableTask> childTasks = taskManager.setBan(request.parentTaskId, request.reason, channel);
                 final GroupedActionListener<Void> listener = new GroupedActionListener<>(
                     childTasks.size() + 1,
-                    new ChannelActionListener<>(channel).map(r -> TransportResponse.Empty.INSTANCE)
+                    new ChannelActionListener<>(channel).map(r -> ActionResponse.Empty.INSTANCE)
                 );
                 for (CancellableTask childTask : childTasks) {
                     cancelTaskAndDescendants(childTask, request.reason, request.waitForCompletion, listener);
@@ -370,7 +370,7 @@ public class TaskCancellationService {
             } else {
                 logger.debug("Removing ban for the parent [{}] on the node [{}]", request.parentTaskId, localNodeId());
                 taskManager.removeBan(request.parentTaskId);
-                channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                channel.sendResponse(ActionResponse.Empty.INSTANCE);
             }
         }
     }
@@ -411,7 +411,7 @@ public class TaskCancellationService {
         @Override
         public void messageReceived(final CancelChildRequest request, final TransportChannel channel, Task task) throws Exception {
             taskManager.cancelChildLocal(request.parentTaskId, request.childRequestId, request.reason);
-            channel.sendResponse(TransportResponse.Empty.INSTANCE);
+            channel.sendResponse(ActionResponse.Empty.INSTANCE);
         }
     }
 

+ 1 - 20
server/src/main/java/org/elasticsearch/transport/TransportResponse.java

@@ -9,28 +9,9 @@
 
 package org.elasticsearch.transport;
 
-import org.elasticsearch.common.io.stream.StreamOutput;
-
-import java.io.IOException;
-
 public abstract class TransportResponse extends TransportMessage {
-
     /**
      * Constructs a new empty transport response
      */
-    public TransportResponse() {}
-
-    public static class Empty extends TransportResponse {
-        public static final Empty INSTANCE = new Empty();
-
-        private Empty() {/* singleton */}
-
-        @Override
-        public String toString() {
-            return "Empty{}";
-        }
-
-        @Override
-        public void writeTo(StreamOutput out) throws IOException {}
-    }
+    protected TransportResponse() {}
 }

+ 6 - 5
server/src/main/java/org/elasticsearch/transport/TransportResponseHandler.java

@@ -10,6 +10,7 @@
 package org.elasticsearch.transport;
 
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.common.io.stream.StreamInput;
 import org.elasticsearch.common.io.stream.Writeable;
 import org.elasticsearch.common.util.concurrent.EsExecutors;
@@ -31,16 +32,16 @@ public interface TransportResponseHandler<T extends TransportResponse> extends W
     void handleException(TransportException exp);
 
     /**
-     * Implementation of {@link TransportResponseHandler} that handles the empty response {@link TransportResponse.Empty}.
+     * Implementation of {@link TransportResponseHandler} that handles the empty response {@link ActionResponse.Empty}.
      */
-    abstract class Empty implements TransportResponseHandler<TransportResponse.Empty> {
+    abstract class Empty implements TransportResponseHandler<ActionResponse.Empty> {
         @Override
-        public final TransportResponse.Empty read(StreamInput in) {
-            return TransportResponse.Empty.INSTANCE;
+        public final ActionResponse.Empty read(StreamInput in) {
+            return ActionResponse.Empty.INSTANCE;
         }
 
         @Override
-        public final void handleResponse(TransportResponse.Empty ignored) {
+        public final void handleResponse(ActionResponse.Empty ignored) {
             handleResponse();
         }
 

+ 2 - 2
server/src/test/java/org/elasticsearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java

@@ -10,6 +10,7 @@ package org.elasticsearch.action.admin.indices.close;
 
 import org.apache.lucene.util.SetOnce;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.admin.indices.flush.FlushRequest;
 import org.elasticsearch.action.support.ActionFilters;
 import org.elasticsearch.action.support.PlainActionFuture;
@@ -44,7 +45,6 @@ import org.elasticsearch.test.ESTestCase;
 import org.elasticsearch.test.transport.CapturingTransport;
 import org.elasticsearch.threadpool.TestThreadPool;
 import org.elasticsearch.threadpool.ThreadPool;
-import org.elasticsearch.transport.TransportResponse;
 import org.elasticsearch.transport.TransportService;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -319,7 +319,7 @@ public class TransportVerifyShardBeforeCloseActionTests extends ESTestCase {
                 assertThat(capturedRequest.request(), instanceOf(ShardStateAction.FailedShardEntry.class));
                 String allocationId = ((ShardStateAction.FailedShardEntry) capturedRequest.request()).getAllocationId();
                 assertTrue(unavailableShards.stream().anyMatch(shardRouting -> shardRouting.allocationId().getId().equals(allocationId)));
-                transport.handleResponse(capturedRequest.requestId(), TransportResponse.Empty.INSTANCE);
+                transport.handleResponse(capturedRequest.requestId(), ActionResponse.Empty.INSTANCE);
 
             } else if (actionName.startsWith(TransportVerifyShardBeforeCloseAction.NAME)) {
                 assertThat(capturedRequest.request(), instanceOf(ConcreteShardRequest.class));

+ 2 - 1
server/src/test/java/org/elasticsearch/action/search/ClearScrollControllerTests.java

@@ -9,6 +9,7 @@
 package org.elasticsearch.action.search;
 
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.LatchedActionListener;
 import org.elasticsearch.action.support.ActionTestUtils;
 import org.elasticsearch.cluster.node.DiscoveryNode;
@@ -54,7 +55,7 @@ public class ClearScrollControllerTests extends ESTestCase {
             @Override
             public void sendClearAllScrollContexts(Transport.Connection connection, ActionListener<TransportResponse> listener) {
                 nodesInvoked.add(connection.getNode());
-                Thread t = new Thread(() -> listener.onResponse(TransportResponse.Empty.INSTANCE)); // response is unused
+                Thread t = new Thread(() -> listener.onResponse(ActionResponse.Empty.INSTANCE)); // response is unused
                 t.start();
             }
 

+ 10 - 10
server/src/test/java/org/elasticsearch/action/support/replication/TransportWriteActionTests.java

@@ -11,6 +11,7 @@ package org.elasticsearch.action.support.replication;
 
 import org.elasticsearch.ElasticsearchException;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.support.ActionFilters;
 import org.elasticsearch.action.support.ActionTestUtils;
 import org.elasticsearch.action.support.PlainActionFuture;
@@ -54,7 +55,6 @@ import org.elasticsearch.threadpool.TestThreadPool;
 import org.elasticsearch.threadpool.ThreadPool;
 import org.elasticsearch.transport.Transport;
 import org.elasticsearch.transport.TransportException;
-import org.elasticsearch.transport.TransportResponse;
 import org.elasticsearch.transport.TransportService;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -156,8 +156,8 @@ public class TransportWriteActionTests extends ESTestCase {
         final PlainActionFuture<TransportReplicationAction.ReplicaResult> future = new PlainActionFuture<>();
         testAction.dispatchedShardOperationOnReplica(request, indexShard, future);
         final TransportReplicationAction.ReplicaResult result = future.actionGet();
-        CapturingActionListener<TransportResponse.Empty> listener = new CapturingActionListener<>();
-        result.runPostReplicaActions(listener.map(ignore -> TransportResponse.Empty.INSTANCE));
+        CapturingActionListener<ActionResponse.Empty> listener = new CapturingActionListener<>();
+        result.runPostReplicaActions(listener.map(ignore -> ActionResponse.Empty.INSTANCE));
         assertNotNull(listener.response);
         assertNull(listener.failure);
         verify(indexShard, never()).refresh(any());
@@ -195,8 +195,8 @@ public class TransportWriteActionTests extends ESTestCase {
         final PlainActionFuture<TransportReplicationAction.ReplicaResult> future = new PlainActionFuture<>();
         testAction.dispatchedShardOperationOnReplica(request, indexShard, future);
         final TransportReplicationAction.ReplicaResult result = future.actionGet();
-        CapturingActionListener<TransportResponse.Empty> listener = new CapturingActionListener<>();
-        result.runPostReplicaActions(listener.map(ignore -> TransportResponse.Empty.INSTANCE));
+        CapturingActionListener<ActionResponse.Empty> listener = new CapturingActionListener<>();
+        result.runPostReplicaActions(listener.map(ignore -> ActionResponse.Empty.INSTANCE));
         assertNull(listener.response); // Haven't responded yet
         @SuppressWarnings({ "unchecked", "rawtypes" })
         ArgumentCaptor<ActionListener<Engine.RefreshResult>> refreshListener = ArgumentCaptor.forClass((Class) ActionListener.class);
@@ -242,8 +242,8 @@ public class TransportWriteActionTests extends ESTestCase {
         final PlainActionFuture<TransportReplicationAction.ReplicaResult> future = new PlainActionFuture<>();
         testAction.dispatchedShardOperationOnReplica(request, indexShard, future);
         final TransportReplicationAction.ReplicaResult result = future.actionGet();
-        CapturingActionListener<TransportResponse.Empty> listener = new CapturingActionListener<>();
-        result.runPostReplicaActions(listener.map(ignore -> TransportResponse.Empty.INSTANCE));
+        CapturingActionListener<ActionResponse.Empty> listener = new CapturingActionListener<>();
+        result.runPostReplicaActions(listener.map(ignore -> ActionResponse.Empty.INSTANCE));
         assertNull(listener.response); // Haven't responded yet
         @SuppressWarnings({ "unchecked", "rawtypes" })
         ArgumentCaptor<Consumer<Boolean>> refreshListener = ArgumentCaptor.forClass((Class) Consumer.class);
@@ -275,8 +275,8 @@ public class TransportWriteActionTests extends ESTestCase {
         final PlainActionFuture<TransportReplicationAction.ReplicaResult> future = new PlainActionFuture<>();
         testAction.dispatchedShardOperationOnReplica(request, indexShard, future);
         final TransportReplicationAction.ReplicaResult result = future.actionGet();
-        CapturingActionListener<TransportResponse.Empty> listener = new CapturingActionListener<>();
-        result.runPostReplicaActions(listener.map(ignore -> TransportResponse.Empty.INSTANCE));
+        CapturingActionListener<ActionResponse.Empty> listener = new CapturingActionListener<>();
+        result.runPostReplicaActions(listener.map(ignore -> ActionResponse.Empty.INSTANCE));
         assertNull(listener.response);
         assertNotNull(listener.failure);
     }
@@ -379,7 +379,7 @@ public class TransportWriteActionTests extends ESTestCase {
         assertEquals(shardEntry.getAllocationId(), replica.allocationId().getId());
         if (randomBoolean()) {
             // simulate success
-            transport.handleResponse(shardFailedRequest.requestId(), TransportResponse.Empty.INSTANCE);
+            transport.handleResponse(shardFailedRequest.requestId(), ActionResponse.Empty.INSTANCE);
             assertTrue(success.get());
             assertNull(failure.get());
         } else if (randomBoolean()) {

+ 8 - 8
server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStateActionTests.java

@@ -14,6 +14,7 @@ import org.apache.lucene.util.SetOnce;
 import org.elasticsearch.TransportVersion;
 import org.elasticsearch.TransportVersions;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.support.replication.ClusterStateCreationUtils;
 import org.elasticsearch.cluster.ClusterState;
 import org.elasticsearch.cluster.ClusterStateObserver;
@@ -43,7 +44,6 @@ import org.elasticsearch.transport.NodeDisconnectedException;
 import org.elasticsearch.transport.NodeNotConnectedException;
 import org.elasticsearch.transport.TransportException;
 import org.elasticsearch.transport.TransportRequest;
-import org.elasticsearch.transport.TransportResponse;
 import org.elasticsearch.transport.TransportService;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -179,7 +179,7 @@ public class ShardStateActionTests extends ESTestCase {
         // sent to the master
         assertEquals(clusterService.state().nodes().getMasterNode().getId(), capturedRequests[0].node().getId());
 
-        transport.handleResponse(capturedRequests[0].requestId(), TransportResponse.Empty.INSTANCE);
+        transport.handleResponse(capturedRequests[0].requestId(), ActionResponse.Empty.INSTANCE);
 
         listener.await();
         assertNull(listener.failure.get());
@@ -305,7 +305,7 @@ public class ShardStateActionTests extends ESTestCase {
         shardStateAction.localShardFailed(failedShard, "test", getSimulatedFailure(), listener);
 
         CapturingTransport.CapturedRequest[] capturedRequests = transport.getCapturedRequestsAndClear();
-        transport.handleResponse(capturedRequests[0].requestId(), TransportResponse.Empty.INSTANCE);
+        transport.handleResponse(capturedRequests[0].requestId(), ActionResponse.Empty.INSTANCE);
 
         listener.await();
         assertNull(listener.failure.get());
@@ -377,7 +377,7 @@ public class ShardStateActionTests extends ESTestCase {
         }
         CapturingTransport.CapturedRequest[] capturedRequests = transport.getCapturedRequestsAndClear();
         assertThat(capturedRequests, arrayWithSize(1));
-        transport.handleResponse(capturedRequests[0].requestId(), TransportResponse.Empty.INSTANCE);
+        transport.handleResponse(capturedRequests[0].requestId(), ActionResponse.Empty.INSTANCE);
         latch.await();
         assertThat(transport.capturedRequests(), arrayWithSize(0));
     }
@@ -417,7 +417,7 @@ public class ShardStateActionTests extends ESTestCase {
         CapturingTransport.CapturedRequest[] capturedRequests = transport.getCapturedRequestsAndClear();
         assertThat(capturedRequests, arrayWithSize(expectedRequests));
         for (int i = 0; i < expectedRequests; i++) {
-            transport.handleResponse(capturedRequests[i].requestId(), TransportResponse.Empty.INSTANCE);
+            transport.handleResponse(capturedRequests[i].requestId(), ActionResponse.Empty.INSTANCE);
         }
         latch.await();
         assertThat(transport.capturedRequests(), arrayWithSize(0));
@@ -439,7 +439,7 @@ public class ShardStateActionTests extends ESTestCase {
             while (shutdown.get() == false) {
                 for (CapturingTransport.CapturedRequest request : transport.getCapturedRequestsAndClear()) {
                     if (randomBoolean()) {
-                        transport.handleResponse(request.requestId(), TransportResponse.Empty.INSTANCE);
+                        transport.handleResponse(request.requestId(), ActionResponse.Empty.INSTANCE);
                     } else {
                         transport.handleRemoteError(request.requestId(), randomFrom(getSimulatedFailure()));
                     }
@@ -504,7 +504,7 @@ public class ShardStateActionTests extends ESTestCase {
         assertThat(entry.primaryTerm, equalTo(primaryTerm));
         assertThat(entry.timestampRange, sameInstance(ShardLongFieldRange.UNKNOWN));
 
-        transport.handleResponse(capturedRequests[0].requestId(), TransportResponse.Empty.INSTANCE);
+        transport.handleResponse(capturedRequests[0].requestId(), ActionResponse.Empty.INSTANCE);
         listener.await();
         assertNull(listener.failure.get());
     }
@@ -537,7 +537,7 @@ public class ShardStateActionTests extends ESTestCase {
             retries.incrementAndGet();
             if (retries.get() == numberOfRetries) {
                 // finish the request
-                transport.handleResponse(capturedRequests[0].requestId(), TransportResponse.Empty.INSTANCE);
+                transport.handleResponse(capturedRequests[0].requestId(), ActionResponse.Empty.INSTANCE);
             } else {
                 retryLoop.accept(capturedRequests[0].requestId());
             }

+ 3 - 3
server/src/test/java/org/elasticsearch/cluster/coordination/FollowersCheckerTests.java

@@ -11,6 +11,8 @@ package org.elasticsearch.cluster.coordination;
 import org.elasticsearch.Build;
 import org.elasticsearch.ElasticsearchException;
 import org.elasticsearch.Version;
+import org.elasticsearch.action.ActionResponse;
+import org.elasticsearch.action.ActionResponse.Empty;
 import org.elasticsearch.cluster.ClusterName;
 import org.elasticsearch.cluster.coordination.Coordinator.Mode;
 import org.elasticsearch.cluster.coordination.FollowersChecker.FollowerCheckRequest;
@@ -34,8 +36,6 @@ import org.elasticsearch.transport.AbstractSimpleTransportTestCase;
 import org.elasticsearch.transport.ConnectTransportException;
 import org.elasticsearch.transport.TransportException;
 import org.elasticsearch.transport.TransportRequest;
-import org.elasticsearch.transport.TransportResponse;
-import org.elasticsearch.transport.TransportResponse.Empty;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 
@@ -377,7 +377,7 @@ public class FollowersCheckerTests extends ESTestCase {
 
     private void testBehaviourOfFailingNode(
         Settings testSettings,
-        Supplier<TransportResponse.Empty> responder,
+        Supplier<ActionResponse.Empty> responder,
         String failureReason,
         long expectedFailureTime,
         NodeHealthService nodeHealthService

+ 2 - 2
server/src/test/java/org/elasticsearch/cluster/coordination/JoinHelperTests.java

@@ -11,6 +11,7 @@ package org.elasticsearch.cluster.coordination;
 import org.apache.logging.log4j.Level;
 import org.elasticsearch.Build;
 import org.elasticsearch.ElasticsearchException;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.support.PlainActionFuture;
 import org.elasticsearch.cluster.ClusterName;
 import org.elasticsearch.cluster.NotMasterException;
@@ -38,7 +39,6 @@ import org.elasticsearch.transport.ClusterConnectionManager;
 import org.elasticsearch.transport.RemoteTransportException;
 import org.elasticsearch.transport.TransportException;
 import org.elasticsearch.transport.TransportRequest;
-import org.elasticsearch.transport.TransportResponse;
 import org.elasticsearch.transport.TransportService;
 
 import java.util.HashSet;
@@ -185,7 +185,7 @@ public class JoinHelperTests extends ESTestCase {
 
     private void completeJoinRequest(CapturingTransport capturingTransport, CapturedRequest request, boolean mightSucceed) {
         if (mightSucceed && randomBoolean()) {
-            capturingTransport.handleResponse(request.requestId(), TransportResponse.Empty.INSTANCE);
+            capturingTransport.handleResponse(request.requestId(), ActionResponse.Empty.INSTANCE);
         } else {
             capturingTransport.handleRemoteError(request.requestId(), new CoordinationStateRejectedException("dummy"));
         }

+ 7 - 6
server/src/test/java/org/elasticsearch/cluster/coordination/JoinValidationServiceTests.java

@@ -14,6 +14,7 @@ import org.elasticsearch.TransportVersion;
 import org.elasticsearch.Version;
 import org.elasticsearch.action.ActionListener;
 import org.elasticsearch.action.ActionListenerResponseHandler;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.support.PlainActionFuture;
 import org.elasticsearch.cluster.ClusterName;
 import org.elasticsearch.cluster.ClusterState;
@@ -124,7 +125,7 @@ public class JoinValidationServiceTests extends ESTestCase {
                                 public void doRun() {
                                     handleResponse(requestId, switch (action) {
                                         case JoinValidationService.JOIN_VALIDATE_ACTION_NAME, JoinHelper.JOIN_PING_ACTION_NAME ->
-                                            TransportResponse.Empty.INSTANCE;
+                                            ActionResponse.Empty.INSTANCE;
                                         case TransportService.HANDSHAKE_ACTION_NAME -> new TransportService.HandshakeResponse(
                                             Version.CURRENT,
                                             Build.current().hash(),
@@ -402,12 +403,12 @@ public class JoinValidationServiceTests extends ESTestCase {
             .metadata(Metadata.builder().generateClusterUuidIfNeeded())
             .build();
 
-        final var future = new PlainActionFuture<TransportResponse.Empty>();
+        final var future = new PlainActionFuture<ActionResponse.Empty>();
         transportService.sendRequest(
             localNode,
             JoinValidationService.JOIN_VALIDATE_ACTION_NAME,
             serializeClusterState(otherClusterState),
-            new ActionListenerResponseHandler<>(future, in -> TransportResponse.Empty.INSTANCE, TransportResponseHandler.TRANSPORT_WORKER)
+            new ActionListenerResponseHandler<>(future, in -> ActionResponse.Empty.INSTANCE, TransportResponseHandler.TRANSPORT_WORKER)
         );
         deterministicTaskQueue.runAllTasks();
 
@@ -470,12 +471,12 @@ public class JoinValidationServiceTests extends ESTestCase {
         transportService.start();
         transportService.acceptIncomingRequests();
 
-        final var future = new PlainActionFuture<TransportResponse.Empty>();
+        final var future = new PlainActionFuture<ActionResponse.Empty>();
         transportService.sendRequest(
             localNode,
             JoinValidationService.JOIN_VALIDATE_ACTION_NAME,
             serializeClusterState(stateForValidation),
-            new ActionListenerResponseHandler<>(future, in -> TransportResponse.Empty.INSTANCE, TransportResponseHandler.TRANSPORT_WORKER)
+            new ActionListenerResponseHandler<>(future, in -> ActionResponse.Empty.INSTANCE, TransportResponseHandler.TRANSPORT_WORKER)
         );
         deterministicTaskQueue.runAllTasks();
 
@@ -495,7 +496,7 @@ public class JoinValidationServiceTests extends ESTestCase {
                 assertSame(node, joiningNode);
                 assertEquals(JoinHelper.JOIN_PING_ACTION_NAME, action);
                 assertTrue(pingSeen.compareAndSet(false, true));
-                handleResponse(requestId, TransportResponse.Empty.INSTANCE);
+                handleResponse(requestId, ActionResponse.Empty.INSTANCE);
             }
         };
         final var masterTransportService = masterTransport.createTransportService(

+ 6 - 6
server/src/test/java/org/elasticsearch/cluster/coordination/LeaderCheckerTests.java

@@ -13,6 +13,8 @@ import org.elasticsearch.Build;
 import org.elasticsearch.ElasticsearchException;
 import org.elasticsearch.ExceptionsHelper;
 import org.elasticsearch.Version;
+import org.elasticsearch.action.ActionResponse;
+import org.elasticsearch.action.ActionResponse.Empty;
 import org.elasticsearch.cluster.ClusterName;
 import org.elasticsearch.cluster.coordination.LeaderChecker.LeaderCheckRequest;
 import org.elasticsearch.cluster.node.DiscoveryNode;
@@ -33,8 +35,6 @@ import org.elasticsearch.transport.ReceiveTimeoutTransportException;
 import org.elasticsearch.transport.RemoteTransportException;
 import org.elasticsearch.transport.TransportException;
 import org.elasticsearch.transport.TransportRequest;
-import org.elasticsearch.transport.TransportResponse;
-import org.elasticsearch.transport.TransportResponse.Empty;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 
@@ -554,7 +554,7 @@ public class LeaderCheckerTests extends ESTestCase {
         }
     }
 
-    private static class CapturingTransportResponseHandler implements TransportResponseHandler<TransportResponse.Empty> {
+    private static class CapturingTransportResponseHandler implements TransportResponseHandler<ActionResponse.Empty> {
 
         TransportException transportException;
         boolean successfulResponseReceived;
@@ -565,7 +565,7 @@ public class LeaderCheckerTests extends ESTestCase {
         }
 
         @Override
-        public void handleResponse(TransportResponse.Empty response) {
+        public void handleResponse(ActionResponse.Empty response) {
             successfulResponseReceived = true;
         }
 
@@ -580,8 +580,8 @@ public class LeaderCheckerTests extends ESTestCase {
         }
 
         @Override
-        public TransportResponse.Empty read(StreamInput in) {
-            return TransportResponse.Empty.INSTANCE;
+        public ActionResponse.Empty read(StreamInput in) {
+            return ActionResponse.Empty.INSTANCE;
         }
     }
 

+ 2 - 1
server/src/test/java/org/elasticsearch/cluster/coordination/NodeJoinTests.java

@@ -10,6 +10,7 @@ package org.elasticsearch.cluster.coordination;
 
 import org.elasticsearch.Build;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.support.PlainActionFuture;
 import org.elasticsearch.cluster.ClusterName;
 import org.elasticsearch.cluster.ClusterState;
@@ -196,7 +197,7 @@ public class NodeJoinTests extends ESTestCase {
                     );
                 } else if (action.equals(JoinValidationService.JOIN_VALIDATE_ACTION_NAME)
                     || action.equals(JoinHelper.JOIN_PING_ACTION_NAME)) {
-                        handleResponse(requestId, TransportResponse.Empty.INSTANCE);
+                        handleResponse(requestId, ActionResponse.Empty.INSTANCE);
                     } else {
                         super.onSendRequest(requestId, action, request, destination);
                     }

+ 5 - 5
server/src/test/java/org/elasticsearch/rest/action/RestBuilderListenerTests.java

@@ -9,14 +9,14 @@
 
 package org.elasticsearch.rest.action;
 
+import org.elasticsearch.action.ActionResponse;
+import org.elasticsearch.action.ActionResponse.Empty;
 import org.elasticsearch.common.bytes.BytesArray;
 import org.elasticsearch.rest.RestResponse;
 import org.elasticsearch.rest.RestStatus;
 import org.elasticsearch.test.ESTestCase;
 import org.elasticsearch.test.rest.FakeRestChannel;
 import org.elasticsearch.test.rest.FakeRestRequest;
-import org.elasticsearch.transport.TransportResponse;
-import org.elasticsearch.transport.TransportResponse.Empty;
 import org.elasticsearch.xcontent.XContentBuilder;
 
 import java.util.concurrent.atomic.AtomicReference;
@@ -28,7 +28,7 @@ public class RestBuilderListenerTests extends ESTestCase {
 
     public void testXContentBuilderClosedInBuildResponse() throws Exception {
         AtomicReference<XContentBuilder> builderAtomicReference = new AtomicReference<>();
-        RestBuilderListener<TransportResponse.Empty> builderListener = new RestBuilderListener<>(
+        RestBuilderListener<ActionResponse.Empty> builderListener = new RestBuilderListener<>(
             new FakeRestChannel(new FakeRestRequest(), randomBoolean(), 1)
         ) {
             @Override
@@ -46,7 +46,7 @@ public class RestBuilderListenerTests extends ESTestCase {
 
     public void testXContentBuilderNotClosedInBuildResponseAssertionsDisabled() throws Exception {
         AtomicReference<XContentBuilder> builderAtomicReference = new AtomicReference<>();
-        RestBuilderListener<TransportResponse.Empty> builderListener = new RestBuilderListener<>(
+        RestBuilderListener<ActionResponse.Empty> builderListener = new RestBuilderListener<>(
             new FakeRestChannel(new FakeRestRequest(), randomBoolean(), 1)
         ) {
             @Override
@@ -70,7 +70,7 @@ public class RestBuilderListenerTests extends ESTestCase {
     public void testXContentBuilderNotClosedInBuildResponseAssertionsEnabled() {
         assumeTrue("tests are not being run with assertions", RestBuilderListener.class.desiredAssertionStatus());
 
-        RestBuilderListener<TransportResponse.Empty> builderListener = new RestBuilderListener<>(
+        RestBuilderListener<ActionResponse.Empty> builderListener = new RestBuilderListener<>(
             new FakeRestChannel(new FakeRestRequest(), randomBoolean(), 1)
         ) {
             @Override

+ 2 - 1
server/src/test/java/org/elasticsearch/transport/TaskTransportChannelTests.java

@@ -11,6 +11,7 @@ package org.elasticsearch.transport;
 
 import org.elasticsearch.ElasticsearchException;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.core.CheckedConsumer;
 import org.elasticsearch.test.ESTestCase;
 
@@ -21,7 +22,7 @@ public class TaskTransportChannelTests extends ESTestCase {
 
     public void testClosesTaskAfterChannelHandoff() throws IOException {
         runCompletionOrderTest(c -> c.sendResponse(new ElasticsearchException("simulated")));
-        runCompletionOrderTest(c -> c.sendResponse(TransportResponse.Empty.INSTANCE));
+        runCompletionOrderTest(c -> c.sendResponse(ActionResponse.Empty.INSTANCE));
     }
 
     private void runCompletionOrderTest(CheckedConsumer<TransportChannel, IOException> channelConsumer) throws IOException {

+ 8 - 7
server/src/test/java/org/elasticsearch/transport/TransportServiceDeserializationFailureTests.java

@@ -11,6 +11,7 @@ package org.elasticsearch.transport;
 
 import org.elasticsearch.Build;
 import org.elasticsearch.Version;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.support.PlainActionFuture;
 import org.elasticsearch.cluster.ClusterName;
 import org.elasticsearch.cluster.node.DiscoveryNode;
@@ -71,7 +72,7 @@ public class TransportServiceDeserializationFailureTests extends ESTestCase {
             testActionName,
             EsExecutors.DIRECT_EXECUTOR_SERVICE,
             EmptyRequest::new,
-            (request, channel, task) -> channel.sendResponse(TransportResponse.Empty.INSTANCE)
+            (request, channel, task) -> channel.sendResponse(ActionResponse.Empty.INSTANCE)
         );
 
         transportService.start();
@@ -89,14 +90,14 @@ public class TransportServiceDeserializationFailureTests extends ESTestCase {
                 testActionName,
                 new EmptyRequest(),
                 TransportRequestOptions.EMPTY,
-                new TransportResponseHandler<TransportResponse.Empty>() {
+                new TransportResponseHandler<ActionResponse.Empty>() {
                     @Override
                     public Executor executor() {
                         return TransportResponseHandler.TRANSPORT_WORKER;
                     }
 
                     @Override
-                    public void handleResponse(TransportResponse.Empty response) {
+                    public void handleResponse(ActionResponse.Empty response) {
                         fail("should not be called");
                     }
 
@@ -106,7 +107,7 @@ public class TransportServiceDeserializationFailureTests extends ESTestCase {
                     }
 
                     @Override
-                    public TransportResponse.Empty read(StreamInput in) {
+                    public ActionResponse.Empty read(StreamInput in) {
                         throw new AssertionError("should not be called");
                     }
 
@@ -155,14 +156,14 @@ public class TransportServiceDeserializationFailureTests extends ESTestCase {
                 new EmptyRequest(),
                 parentTask,
                 TransportRequestOptions.EMPTY,
-                new TransportResponseHandler<TransportResponse.Empty>() {
+                new TransportResponseHandler<ActionResponse.Empty>() {
                     @Override
                     public Executor executor() {
                         return TransportResponseHandler.TRANSPORT_WORKER;
                     }
 
                     @Override
-                    public void handleResponse(TransportResponse.Empty response) {
+                    public void handleResponse(ActionResponse.Empty response) {
                         fail("should not be called");
                     }
 
@@ -172,7 +173,7 @@ public class TransportServiceDeserializationFailureTests extends ESTestCase {
                     }
 
                     @Override
-                    public TransportResponse.Empty read(StreamInput in) {
+                    public ActionResponse.Empty read(StreamInput in) {
                         throw new AssertionError("should not be called");
                     }
 

+ 11 - 10
server/src/test/java/org/elasticsearch/transport/TransportServiceLifecycleTests.java

@@ -13,6 +13,7 @@ import org.elasticsearch.ElasticsearchException;
 import org.elasticsearch.TransportVersion;
 import org.elasticsearch.action.ActionListener;
 import org.elasticsearch.action.ActionListenerResponseHandler;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.support.ActionTestUtils;
 import org.elasticsearch.action.support.PlainActionFuture;
 import org.elasticsearch.cluster.node.DiscoveryNode;
@@ -79,14 +80,14 @@ public class TransportServiceLifecycleTests extends ESTestCase {
                                 randomFrom(random, nodeA, nodeB).transportService.getLocalNode(),
                                 TestNode.randomActionName(random),
                                 new EmptyRequest(),
-                                new TransportResponseHandler<TransportResponse.Empty>() {
+                                new TransportResponseHandler<ActionResponse.Empty>() {
 
                                     final AtomicBoolean completed = new AtomicBoolean();
 
                                     final Executor executor = nodeB.randomExecutor();
 
                                     @Override
-                                    public void handleResponse(TransportResponse.Empty response) {
+                                    public void handleResponse(ActionResponse.Empty response) {
                                         assertTrue(completed.compareAndSet(false, true));
                                         requestPermits.release();
                                     }
@@ -98,8 +99,8 @@ public class TransportServiceLifecycleTests extends ESTestCase {
                                     }
 
                                     @Override
-                                    public TransportResponse.Empty read(StreamInput in) {
-                                        return TransportResponse.Empty.INSTANCE;
+                                    public ActionResponse.Empty read(StreamInput in) {
+                                        return ActionResponse.Empty.INSTANCE;
                                     }
 
                                     @Override
@@ -132,7 +133,7 @@ public class TransportServiceLifecycleTests extends ESTestCase {
         final var deterministicTaskQueue = new DeterministicTaskQueue();
 
         try (var nodeA = new TestNode("node-A")) {
-            final var future = new PlainActionFuture<TransportResponse.Empty>();
+            final var future = new PlainActionFuture<ActionResponse.Empty>();
             nodeA.transportService.sendRequest(
                 nodeA.getThrowingConnection(),
                 TestNode.randomActionName(random()),
@@ -156,7 +157,7 @@ public class TransportServiceLifecycleTests extends ESTestCase {
                 Settings.builder().put(TransportService.ENABLE_STACK_OVERFLOW_AVOIDANCE.getKey(), true).build()
             )
         ) {
-            final var future = new PlainActionFuture<TransportResponse.Empty>();
+            final var future = new PlainActionFuture<ActionResponse.Empty>();
             nodeA.transportService.sendRequest(
                 nodeA.getThrowingConnection(),
                 TestNode.randomActionName(random()),
@@ -183,7 +184,7 @@ public class TransportServiceLifecycleTests extends ESTestCase {
                 "simulated exception in sendRequest",
                 safeAwaitAndUnwrapFailure(
                     IOException.class,
-                    TransportResponse.Empty.class,
+                    ActionResponse.Empty.class,
                     l -> nodeA.transportService.sendRequest(
                         nodeA.getThrowingConnection(),
                         TestNode.randomActionName(random()),
@@ -212,7 +213,7 @@ public class TransportServiceLifecycleTests extends ESTestCase {
                 }
             }
 
-            final var future = new PlainActionFuture<TransportResponse.Empty>();
+            final var future = new PlainActionFuture<ActionResponse.Empty>();
             try {
                 nodeA.transportService.sendRequest(
                     nodeA.getThrowingConnection(),
@@ -239,7 +240,7 @@ public class TransportServiceLifecycleTests extends ESTestCase {
         nodeA.close();
 
         final var testThread = Thread.currentThread();
-        final var future = new PlainActionFuture<TransportResponse.Empty>();
+        final var future = new PlainActionFuture<ActionResponse.Empty>();
         nodeA.transportService.sendRequest(
             nodeA.getThrowingConnection(),
             TestNode.randomActionName(random()),
@@ -400,7 +401,7 @@ public class TransportServiceLifecycleTests extends ESTestCase {
                     EmptyRequest::new,
                     (request, channel, task) -> {
                         if (randomBoolean()) {
-                            channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                            channel.sendResponse(ActionResponse.Empty.INSTANCE);
                         } else {
                             channel.sendResponse(new ElasticsearchException("simulated"));
                         }

+ 24 - 23
test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java

@@ -19,6 +19,7 @@ import org.elasticsearch.TransportVersions;
 import org.elasticsearch.Version;
 import org.elasticsearch.action.ActionListener;
 import org.elasticsearch.action.ActionListenerResponseHandler;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.support.ActionTestUtils;
 import org.elasticsearch.action.support.ChannelActionListener;
 import org.elasticsearch.action.support.PlainActionFuture;
@@ -518,7 +519,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
         final TransportRequestHandler<EmptyRequest> requestHandler = (request, channel, task) -> {
             try {
                 if (randomBoolean()) {
-                    channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                    channel.sendResponse(ActionResponse.Empty.INSTANCE);
                 } else {
                     channel.sendResponse(new ElasticsearchException("simulated"));
                 }
@@ -652,7 +653,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                 EmptyRequest::new,
                 (request, channel, task) -> {
                     try {
-                        channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                        channel.sendResponse(ActionResponse.Empty.INSTANCE);
                     } catch (Exception e) {
                         logger.error("Unexpected failure", e);
                         fail(e.getMessage());
@@ -670,15 +671,15 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
             ConnectionProfile connectionProfile = ConnectionProfile.buildDefaultConnectionProfile(settingsWithCompress);
             connectToNode(serviceC, serviceA.getLocalNode(), connectionProfile);
 
-            Future<TransportResponse.Empty> res = submitRequest(
+            Future<ActionResponse.Empty> res = submitRequest(
                 serviceC,
                 nodeA,
                 "internal:sayHello",
                 new EmptyRequest(),
                 new TransportResponseHandler<>() {
                     @Override
-                    public TransportResponse.Empty read(StreamInput in) {
-                        return TransportResponse.Empty.INSTANCE;
+                    public ActionResponse.Empty read(StreamInput in) {
+                        return ActionResponse.Empty.INSTANCE;
                     }
 
                     @Override
@@ -687,7 +688,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                     }
 
                     @Override
-                    public void handleResponse(TransportResponse.Empty response) {}
+                    public void handleResponse(ActionResponse.Empty response) {}
 
                     @Override
                     public void handleException(TransportException exp) {
@@ -1085,7 +1086,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                     }
                 }
             );
-            Future<TransportResponse.Empty> foobar = submitRequest(
+            Future<ActionResponse.Empty> foobar = submitRequest(
                 serviceB,
                 nodeA,
                 "internal:foobar",
@@ -1974,7 +1975,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                 TestRequest::new,
                 (request, channel, task) -> {
                     requestProcessed.set(true);
-                    channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                    channel.sendResponse(ActionResponse.Empty.INSTANCE);
                 }
             );
 
@@ -2499,7 +2500,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                 if ("fail".equals(request.info)) {
                     throw new RuntimeException("boom");
                 } else {
-                    channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                    channel.sendResponse(ActionResponse.Empty.INSTANCE);
                 }
             }
         );
@@ -2512,13 +2513,13 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
 
             @Override
             public TransportResponse read(StreamInput in) {
-                return TransportResponse.Empty.INSTANCE;
+                return ActionResponse.Empty.INSTANCE;
             }
 
             @Override
             public void handleResponse(TransportResponse response) {
                 try {
-                    assertSame(response, TransportResponse.Empty.INSTANCE);
+                    assertSame(response, ActionResponse.Empty.INSTANCE);
                     assertTrue(threadPool.getThreadContext().getResponseHeaders().containsKey("foo.bar"));
                     assertEquals(1, threadPool.getThreadContext().getResponseHeaders().get("foo.bar").size());
                     assertEquals("baz", threadPool.getThreadContext().getResponseHeaders().get("foo.bar").get(0));
@@ -2568,7 +2569,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
         TransportResponseHandler<TransportResponse> transportResponseHandler = new TransportResponseHandler<TransportResponse>() {
             @Override
             public TransportResponse read(StreamInput in) {
-                return TransportResponse.Empty.INSTANCE;
+                return ActionResponse.Empty.INSTANCE;
             }
 
             @Override
@@ -2641,13 +2642,13 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                     protected void doRun() throws Exception {
                         receivedLatch.countDown();
                         sendResponseLatch.await();
-                        channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                        channel.sendResponse(ActionResponse.Empty.INSTANCE);
                     }
                 });
             }
         );
         CountDownLatch responseLatch = new CountDownLatch(1);
-        TransportResponseHandler<TransportResponse.Empty> transportResponseHandler = new TransportResponseHandler.Empty() {
+        TransportResponseHandler<ActionResponse.Empty> transportResponseHandler = new TransportResponseHandler.Empty() {
             @Override
             public Executor executor() {
                 return TransportResponseHandler.TRANSPORT_WORKER;
@@ -2709,13 +2710,13 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                     protected void doRun() throws Exception {
                         receivedLatch.countDown();
                         sendResponseLatch.await();
-                        channel.sendResponse(TransportResponse.Empty.INSTANCE);
+                        channel.sendResponse(ActionResponse.Empty.INSTANCE);
                     }
                 });
             }
         );
         CountDownLatch responseLatch = new CountDownLatch(1);
-        TransportResponseHandler<TransportResponse.Empty> transportResponseHandler = new TransportResponseHandler.Empty() {
+        TransportResponseHandler<ActionResponse.Empty> transportResponseHandler = new TransportResponseHandler.Empty() {
             @Override
             public Executor executor() {
                 return TransportResponseHandler.TRANSPORT_WORKER;
@@ -2829,7 +2830,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
         );
         CountDownLatch responseLatch = new CountDownLatch(1);
         AtomicReference<TransportException> receivedException = new AtomicReference<>(null);
-        TransportResponseHandler<TransportResponse.Empty> transportResponseHandler = new TransportResponseHandler.Empty() {
+        TransportResponseHandler<ActionResponse.Empty> transportResponseHandler = new TransportResponseHandler.Empty() {
             @Override
             public Executor executor() {
                 return TransportResponseHandler.TRANSPORT_WORKER;
@@ -3179,7 +3180,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                 )
             );
             assertThat(new ChannelActionListener<>(channel).toString(), containsString(channel.toString()));
-            channel.sendResponse(TransportResponse.Empty.INSTANCE);
+            channel.sendResponse(ActionResponse.Empty.INSTANCE);
         });
         serviceB.registerRequestHandler(ACTION, EsExecutors.DIRECT_EXECUTOR_SERVICE, EmptyRequest::new, (request, channel, task) -> {
             assertThat(
@@ -3192,7 +3193,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                     containsString(serviceB.getLocalNode().getAddress().toString())
                 )
             );
-            channel.sendResponse(TransportResponse.Empty.INSTANCE);
+            channel.sendResponse(ActionResponse.Empty.INSTANCE);
         });
 
         safeAwait(
@@ -3203,7 +3204,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                 new EmptyRequest(),
                 new ActionListenerResponseHandler<>(
                     listener,
-                    ignored -> TransportResponse.Empty.INSTANCE,
+                    ignored -> ActionResponse.Empty.INSTANCE,
                     TransportResponseHandler.TRANSPORT_WORKER
                 )
             )
@@ -3217,7 +3218,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                 new EmptyRequest(),
                 new ActionListenerResponseHandler<>(
                     listener,
-                    ignored -> TransportResponse.Empty.INSTANCE,
+                    ignored -> ActionResponse.Empty.INSTANCE,
                     TransportResponseHandler.TRANSPORT_WORKER
                 )
             )
@@ -3331,7 +3332,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
         serviceA.registerRequestHandler(actionName, EsExecutors.DIRECT_EXECUTOR_SERVICE, EmptyRequest::new, (request, channel, task) -> {
             threadNameFuture.onResponse(Thread.currentThread().getName());
             safeAwait(barrier);
-            channel.sendResponse(TransportResponse.Empty.INSTANCE);
+            channel.sendResponse(ActionResponse.Empty.INSTANCE);
         });
 
         final var responseLatch = new CountDownLatch(1);
@@ -3342,7 +3343,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
             new EmptyRequest(),
             new ActionListenerResponseHandler<TransportResponse>(
                 ActionTestUtils.assertNoFailureListener(t -> responseLatch.countDown()),
-                in -> TransportResponse.Empty.INSTANCE,
+                in -> ActionResponse.Empty.INSTANCE,
                 EsExecutors.DIRECT_EXECUTOR_SERVICE
             )
         );

+ 3 - 3
x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/DriverTaskRunner.java

@@ -10,6 +10,7 @@ package org.elasticsearch.compute.operator;
 import org.elasticsearch.action.ActionListener;
 import org.elasticsearch.action.ActionRequest;
 import org.elasticsearch.action.ActionRequestValidationException;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.CompositeIndicesRequest;
 import org.elasticsearch.action.support.ChannelActionListener;
 import org.elasticsearch.common.io.stream.StreamInput;
@@ -20,7 +21,6 @@ import org.elasticsearch.tasks.TaskId;
 import org.elasticsearch.transport.TransportChannel;
 import org.elasticsearch.transport.TransportRequestHandler;
 import org.elasticsearch.transport.TransportRequestOptions;
-import org.elasticsearch.transport.TransportResponse;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 
@@ -117,13 +117,13 @@ public class DriverTaskRunner {
     private record DriverRequestHandler(TransportService transportService) implements TransportRequestHandler<DriverRequest> {
         @Override
         public void messageReceived(DriverRequest request, TransportChannel channel, Task task) {
-            var listener = new ChannelActionListener<TransportResponse.Empty>(channel);
+            var listener = new ChannelActionListener<ActionResponse.Empty>(channel);
             Driver.start(
                 transportService.getThreadPool().getThreadContext(),
                 request.executor,
                 request.driver,
                 Driver.DEFAULT_MAX_ITERATIONS,
-                listener.map(unused -> TransportResponse.Empty.INSTANCE)
+                listener.map(unused -> ActionResponse.Empty.INSTANCE)
             );
         }
     }

+ 3 - 3
x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/exchange/ExchangeService.java

@@ -13,6 +13,7 @@ import org.elasticsearch.ElasticsearchTimeoutException;
 import org.elasticsearch.ResourceNotFoundException;
 import org.elasticsearch.action.ActionListener;
 import org.elasticsearch.action.ActionListenerResponseHandler;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.action.support.ChannelActionListener;
 import org.elasticsearch.action.support.SubscribableListener;
 import org.elasticsearch.common.breaker.CircuitBreakingException;
@@ -37,7 +38,6 @@ import org.elasticsearch.transport.TransportChannel;
 import org.elasticsearch.transport.TransportRequest;
 import org.elasticsearch.transport.TransportRequestHandler;
 import org.elasticsearch.transport.TransportRequestOptions;
-import org.elasticsearch.transport.TransportResponse;
 import org.elasticsearch.transport.TransportService;
 import org.elasticsearch.transport.Transports;
 
@@ -171,7 +171,7 @@ public final class ExchangeService extends AbstractLifecycleComponent {
             OPEN_EXCHANGE_ACTION_NAME,
             new OpenExchangeRequest(sessionId, exchangeBuffer),
             TransportRequestOptions.EMPTY,
-            new ActionListenerResponseHandler<>(listener.map(unused -> null), in -> TransportResponse.Empty.INSTANCE, responseExecutor)
+            new ActionListenerResponseHandler<>(listener.map(unused -> null), in -> ActionResponse.Empty.INSTANCE, responseExecutor)
         );
     }
 
@@ -228,7 +228,7 @@ public final class ExchangeService extends AbstractLifecycleComponent {
         @Override
         public void messageReceived(OpenExchangeRequest request, TransportChannel channel, Task task) throws Exception {
             createSinkHandler(request.sessionId, request.exchangeBuffer);
-            channel.sendResponse(TransportResponse.Empty.INSTANCE);
+            channel.sendResponse(ActionResponse.Empty.INSTANCE);
         }
     }
 

+ 1 - 1
x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportInterceptorTests.java

@@ -10,6 +10,7 @@ import org.elasticsearch.ElasticsearchSecurityException;
 import org.elasticsearch.TransportVersion;
 import org.elasticsearch.TransportVersions;
 import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ActionResponse.Empty;
 import org.elasticsearch.action.admin.cluster.state.ClusterStateAction;
 import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
 import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
@@ -44,7 +45,6 @@ import org.elasticsearch.transport.TransportInterceptor.AsyncSender;
 import org.elasticsearch.transport.TransportRequest;
 import org.elasticsearch.transport.TransportRequestOptions;
 import org.elasticsearch.transport.TransportResponse;
-import org.elasticsearch.transport.TransportResponse.Empty;
 import org.elasticsearch.transport.TransportResponseHandler;
 import org.elasticsearch.transport.TransportService;
 import org.elasticsearch.xpack.core.security.SecurityContext;

+ 2 - 2
x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SecurityNetty4HeaderSizeLimitTests.java

@@ -8,6 +8,7 @@
 package org.elasticsearch.xpack.security.transport.netty4;
 
 import org.elasticsearch.TransportVersion;
+import org.elasticsearch.action.ActionResponse;
 import org.elasticsearch.common.breaker.CircuitBreaker;
 import org.elasticsearch.common.io.stream.BytesStreamOutput;
 import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@@ -32,7 +33,6 @@ import org.elasticsearch.transport.RequestHandlerRegistry;
 import org.elasticsearch.transport.TcpHeader;
 import org.elasticsearch.transport.TestRequest;
 import org.elasticsearch.transport.TransportMessageListener;
-import org.elasticsearch.transport.TransportResponse;
 import org.elasticsearch.transport.netty4.SharedGroupFactory;
 import org.elasticsearch.xpack.core.XPackSettings;
 import org.elasticsearch.xpack.core.ssl.SSLService;
@@ -108,7 +108,7 @@ public final class SecurityNetty4HeaderSizeLimitTests extends ESTestCase {
                 "internal:test",
                 TestRequest::new,
                 taskManager,
-                (request, channel, task) -> channel.sendResponse(TransportResponse.Empty.INSTANCE),
+                (request, channel, task) -> channel.sendResponse(ActionResponse.Empty.INSTANCE),
                 EsExecutors.DIRECT_EXECUTOR_SERVICE,
                 false,
                 true,