Today all client actions require a Writeable.Reader<Response> as part of their registration process, but in practice (since the removal of the transport client) we only ever call a very small proportion of these readers. More precisely, we only receive an action response over the wire when executing an action on a remote cluster via RemoteClusterAwareClient - in all other cases today we are using a NodeClient which executes the action, and constructs the response, on the local node.
Similarly, there are several implementations of TransportAction which do not inherit from HandledTransportAction or otherwise register a transport handler since they are always executed on the local node. They generally fill in the required, but uncalled, de/serialization methods with something that simply throws an exception. I suspect there's also a good fraction of HandledTransportAction derivatives which are never invoked via the transport layer and therefore could drop their transport handler registration and all of the associated de/serialization code.
I think it'd make sense to decouple the notions of local-client-accessible actions (only invoked on the local node), remote-client-accessible actions (invoked on remote clusters via a remote-cluster client), and transport actions (invoked directly via the transport service, not using a client).
Today all client actions require a
Writeable.Reader<Response>as part of their registration process, but in practice (since the removal of the transport client) we only ever call a very small proportion of these readers. More precisely, we only receive an action response over the wire when executing an action on a remote cluster viaRemoteClusterAwareClient- in all other cases today we are using aNodeClientwhich executes the action, and constructs the response, on the local node.Similarly, there are several implementations of
TransportActionwhich do not inherit fromHandledTransportActionor otherwise register a transport handler since they are always executed on the local node. They generally fill in the required, but uncalled, de/serialization methods with something that simply throws an exception. I suspect there's also a good fraction ofHandledTransportActionderivatives which are never invoked via the transport layer and therefore could drop their transport handler registration and all of the associated de/serialization code.I think it'd make sense to decouple the notions of local-client-accessible actions (only invoked on the local node), remote-client-accessible actions (invoked on remote clusters via a remote-cluster client), and transport actions (invoked directly via the transport service, not using a client).