Skip to content

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 Coordination/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 Coordination/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.

4 participants