Responses can use Writeable.Reader interface#34655
Merged
jaymode merged 11 commits intoelastic:masterfrom Oct 26, 2018
Merged
Conversation
In order to remove Streamable from the codebase, Response objects need to be read using the Writeable.Reader interface which this change enables. This change enables the use of Writeable.Reader by adding the `Action#getResponseReader` method. The default implementation simply uses the existing `newResponse` method and the readFrom method. As responses are migrated to the Writeable.Reader interface, Action classes can be updated to throw an UnsupportedOperationException when `newResponse` is called and override the `getResponseReader` method. Relates elastic#34389
Collaborator
|
Pinging @elastic/es-core-infra |
nik9000
reviewed
Oct 19, 2018
Member
nik9000
left a comment
There was a problem hiding this comment.
Nice! I left a few small things. I think this is wonderful!
| private Map<String, AliasFilter> indicesAndFilters; | ||
|
|
||
| public ClusterSearchShardsResponse() { | ||
| private final ClusterSearchShardsGroup[] groups; |
...src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeAction.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeAction.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/discovery/zen/NodesFaultDetection.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/discovery/zen/MasterFaultDetection.java
Outdated
Show resolved
Hide resolved
| return remoteAddress; | ||
| } | ||
|
|
||
| public TransportMessage() { |
Member
There was a problem hiding this comment.
Hmmm. If it doesn't need StreamInput to be read, maybe don't define either ctor and just use the empty ctor that comes for free. But I see the point of defining this to sort of tell people that it is useful and that subclasses are going to have it. Either way I think some javadoc would be nice.
Member
Author
There was a problem hiding this comment.
I went with adding the constructors due to a comment from @tvernum on another PR #34572 (comment). I see the point of having the constructor with the streaminput; I'll add the javadocs
Member
Author
|
@nik9000 thanks for the review; I've addressed your feedback. |
jasontedor
added a commit
to martijnvg/elasticsearch
that referenced
this pull request
Oct 26, 2018
* master: Introduce cross-cluster replication API docs (elastic#34726) Responses can use Writeable.Reader interface (elastic#34655) SQL: Provide null-safe scripts for Not and Neg (elastic#34877) Fix put/resume follow request parsing (elastic#34913) Fix line length for org.elasticsearch.common.* files (elastic#34888) [ML] Extract common native process base class (elastic#34856) Refactor children aggregator into a generic ParentJoinAggregator (elastic#34845) [Style] Fix line lengths in action.admin.indices (elastic#34890) HLRC - add support for source exists API (elastic#34519)
jaymode
added a commit
that referenced
this pull request
Oct 26, 2018
In order to remove Streamable from the codebase, Response objects need to be read using the Writeable.Reader interface which this change enables. This change enables the use of Writeable.Reader by adding the `Action#getResponseReader` method. The default implementation simply uses the existing `newResponse` method and the readFrom method. As responses are migrated to the Writeable.Reader interface, Action classes can be updated to throw an UnsupportedOperationException when `newResponse` is called and override the `getResponseReader` method. Relates #34389
kcm
pushed a commit
that referenced
this pull request
Oct 30, 2018
In order to remove Streamable from the codebase, Response objects need to be read using the Writeable.Reader interface which this change enables. This change enables the use of Writeable.Reader by adding the `Action#getResponseReader` method. The default implementation simply uses the existing `newResponse` method and the readFrom method. As responses are migrated to the Writeable.Reader interface, Action classes can be updated to throw an UnsupportedOperationException when `newResponse` is called and override the `getResponseReader` method. Relates #34389
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In order to remove Streamable from the codebase, Response objects need
to be read using the Writeable.Reader interface which this change
enables. This change enables the use of Writeable.Reader by adding the
Action#getResponseReadermethod. The default implementation simplyuses the existing
newResponsemethod and the readFrom method. Asresponses are migrated to the Writeable.Reader interface, Action
classes can be updated to throw an UnsupportedOperationException when
newResponseis called and override thegetResponseReadermethod.Relates #34389