Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for skippable named writeables #30948

Closed
wants to merge 1 commit into from

Conversation

ywelsch
Copy link
Contributor

@ywelsch ywelsch commented May 30, 2018

While XContent parsing allows to skip over unknown fields or subobjects, there is no such feature in the StreamInput / StreamOutput world. This PR adds support for skippable named writeables:

  • the NamedWriteableRegistry has an additional parameter to specify which categories are allowed to be skipped. For the transport client, we mark ClusterState.Custom and MetaData.Custom as skippable.
  • StreamOut has a new method writeSkippableNamedWriteable which calculates the number of bytes to be written for the NamedWriteable and writes this as a header.
  • StreamInput has a new method readSkippableNamedWriteable which uses the header written by writeSkippableNamedWriteable to possibly skip the NamedWriteable object.
  • ClusterState.Custom and MetaData.Custom are now written and read using these two new methods writeSkippableNamedWriteable and readSkippableNamedWriteable.
  • Leniency for skipping the customs is only introduced in the transport client. This allows a transport client to deserialize a cluster state even if does not know about all the customs objects.

@ywelsch ywelsch added >enhancement discuss v7.0.0 v6.3.0 :Distributed/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v6.4.0 labels May 30, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@ywelsch
Copy link
Contributor Author

ywelsch commented Jun 1, 2018

Closed in favor of #31020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss :Distributed/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. >enhancement >non-issue v6.3.0 v6.4.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants