Class PublicationTransportHandler

java.lang.Object
org.elasticsearch.cluster.coordination.PublicationTransportHandler

public class PublicationTransportHandler extends Object
Implements the low-level mechanics of sending a cluster state to other nodes in the cluster during a publication.

Cluster states can be quite large and expensive to serialize, but we (mostly) send the same serialized representation to every node in the cluster. This class does the serialization work once, up-front, as part of newPublicationContext(org.elasticsearch.cluster.ClusterStatePublicationEvent) and then just re-uses the resulting bytes across transport messages.

It also uses the Diff mechanism to reduce the data to be transferred wherever possible. This is only a best-effort mechanism so we fall back to sending a full cluster state if the diff cannot be applied for some reason.