Just a proposal here. Feel free to close if non sense.
We have today the following classes for actions:
XXXActionXXXRequestXXXRequestBuilderXXXResponseTransportXXXActionWhen you try to reduce the number of packages, let say for a plugin for example, you might want to put all your actions within the same package. For example, see the reindex plugin:
It has (skipping non related classes):
โโโ DeleteByQueryAction.java
โโโ DeleteByQueryRequest.java
โโโ DeleteByQueryRequestBuilder.java
โโโ ReindexAction.java
โโโ ReindexRequest.java
โโโ ReindexRequestBuilder.java
โโโ RestDeleteByQueryAction.java
โโโ RestReindexAction.java
โโโ RestRethrottleAction.java
โโโ RestUpdateByQueryAction.java
โโโ RethrottleAction.java
โโโ RethrottleRequest.java
โโโ RethrottleRequestBuilder.java
โโโ TransportDeleteByQueryAction.java
โโโ TransportReindexAction.java
โโโ TransportRethrottleAction.java
โโโ TransportUpdateByQueryAction.java
โโโ UpdateByQueryAction.java
โโโ UpdateByQueryRequest.java
โโโ UpdateByQueryRequestBuilder.java
As a developer, I have to scroll up and down every time when I want to open the TransportAction associated with a given Action.
The proposal is to rename TransportXXXAction to XXXTransportAction so all those related classes will be grouped all together.
Thoughts?
Depending on the result of this discussion, we can also imagine a follow up for RestXXXAction which could become XXXRestAction.
The previous example would become:
โโโ DeleteByQueryAction.java
โโโ DeleteByQueryRequest.java
โโโ DeleteByQueryRequestBuilder.java
โโโ DeleteByQueryRestAction.java
โโโ DeleteByQueryTransportAction.java
โโโ ReindexAction.java
โโโ ReindexRequest.java
โโโ ReindexRequestBuilder.java
โโโ ReindexRestAction.java
โโโ ReindexTransportAction.java
โโโ RethrottleAction.java
โโโ RethrottleRequest.java
โโโ RethrottleRequestBuilder.java
โโโ RethrottleRestAction.java
โโโ RethrottleTransportAction.java
โโโ UpdateByQueryAction.java
โโโ UpdateByQueryRequest.java
โโโ UpdateByQueryRequestBuilder.java
โโโ UpdateByQueryRestAction.java
โโโ UpdateByQueryTransportAction.java
+1 on doing both. It'd make reading reindex easier and it only has four
actions.
On Aug 2, 2016 5:48 AM, "David Pilato" [email protected] wrote:
Just a proposal here. Feel free to close if non sense.
We have today the following classes for actions:
- XXXAction
- XXXRequest
- XXXRequestBuilder
- XXXResponse
- TransportXXXAction
When you try to reduce the number of packages, let say for a plugin for
example, you might want to put all your actions within the same package.
For example, see the reindex plugin
https://github.com/elastic/elasticsearch/tree/master/modules/reindex/src/main/java/org/elasticsearch/index/reindex
:It has (skipping non related classes):
โโโ DeleteByQueryAction.java
โโโ DeleteByQueryRequest.java
โโโ DeleteByQueryRequestBuilder.java
โโโ ReindexAction.java
โโโ ReindexRequest.java
โโโ ReindexRequestBuilder.java
โโโ RestDeleteByQueryAction.java
โโโ RestReindexAction.java
โโโ RestRethrottleAction.java
โโโ RestUpdateByQueryAction.java
โโโ RethrottleAction.java
โโโ RethrottleRequest.java
โโโ RethrottleRequestBuilder.java
โโโ TransportDeleteByQueryAction.java
โโโ TransportReindexAction.java
โโโ TransportRethrottleAction.java
โโโ TransportUpdateByQueryAction.java
โโโ UpdateByQueryAction.java
โโโ UpdateByQueryRequest.java
โโโ UpdateByQueryRequestBuilder.javaAs a developer, I have to scroll up and down every time when I want to
open the TransportAction associated with a given Action.The proposal is to rename TransportXXXAction to XXXTransportAction so all
those related classes will be grouped all together.Thoughts?
Depending on the result of this discussion, we can also imagine a follow
up for RestXXXAction which could become XXXRestAction.
The previous example would become:โโโ DeleteByQueryAction.java
โโโ DeleteByQueryRequest.java
โโโ DeleteByQueryRequestBuilder.java
โโโ DeleteByQueryRestAction.java
โโโ DeleteByQueryTransportAction.java
โโโ ReindexAction.java
โโโ ReindexRequest.java
โโโ ReindexRequestBuilder.java
โโโ ReindexRestAction.java
โโโ ReindexTransportAction.java
โโโ RethrottleAction.java
โโโ RethrottleRequest.java
โโโ RethrottleRequestBuilder.java
โโโ RethrottleRestAction.java
โโโ RethrottleTransportAction.java
โโโ UpdateByQueryAction.java
โโโ UpdateByQueryRequest.java
โโโ UpdateByQueryRequestBuilder.java
โโโ UpdateByQueryRestAction.java
โโโ UpdateByQueryTransportAction.javaโ
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/elastic/elasticsearch/issues/19737, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AANLogFbAgj3pe2X-VUY-76QCk74r6QCks5qbxJqgaJpZM4JabZN
.
+1
Conceptually, the class name TransportReindexAction communicates _exactly_ what the class is doing, it transports the reindex action. However, the name ReindexTransportAction does not communicate this. For this reason, I prefer the current naming scheme and I'm opposed to this change.
it transports the reindex action
I think of it as _implementing_ the reindex action rather than _transporting_ it.
I think of it as implementing the reindex action rather than transporting it.
That was my initial thought as well. If it is, we should may be rename with something more obvious like ReindexActionImplementation (just a proposal here)?
I think of it as implementing the reindex action rather than transporting it.
But that's what I mean? It coordinates and executes the entire action. Look at something like TransportBroadcastByNodeAction. At the start of the request, it transports a node-level request to each node responsible for executing node-level operations. Each node receives these requests, executes the operations, and transports the result back to the coordinating node. The coordinating node then collects these results, and notifies the action listener.
It coordinates and executes the entire action.
I've always thought of the coordination and execution portions as "more than" transporting the action though.
I've always referred to these classes in my head as the "transport actions" as opposed to the "rest actions". The latter is the code executed on the rest layer which then delegates to the former, which is the corresponding action that executes on the transport layer. That's why I don't read "transport" as a verb and I would be in favour of the proposed rename.
And the fact that it would help keeping classes for the same api closer rather than far apart is a plus too.
Do we have any veto on this?
It's "just" about renaming. Should I try to get that before 5.0.0 Beta or GA? Or do we prefer doing this for 6.0?
@clintongormley @s1monw what do you think?
Should I close it or work on a PR against 6.0 branch?
Given that we didn't reach consensus on this, I don't think we should do it. Closing.
Most helpful comment
I've always referred to these classes in my head as the "transport actions" as opposed to the "rest actions". The latter is the code executed on the rest layer which then delegates to the former, which is the corresponding action that executes on the transport layer. That's why I don't read "transport" as a verb and I would be in favour of the proposed rename.
And the fact that it would help keeping classes for the same api closer rather than far apart is a plus too.