Class PublicationTransportHandler
java.lang.Object
org.elasticsearch.cluster.coordination.PublicationTransportHandler
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Publishing a cluster state typically involves sending the same cluster state (or diff) to every node, so the work of diffing, serializing, and compressing the state can be done once and the results shared across publish requests. -
Field Summary
-
Constructor Summary
ConstructorDescriptionPublicationTransportHandler
(TransportService transportService, NamedWriteableRegistry namedWriteableRegistry, Function<PublishRequest, PublishWithJoinResponse> handlePublishRequest) -
Method Summary
Modifier and TypeMethodDescriptionnewPublicationContext
(ClusterStatePublicationEvent clusterStatePublicationEvent) stats()
-
Field Details
-
PUBLISH_STATE_ACTION_NAME
- See Also:
-
-
Constructor Details
-
PublicationTransportHandler
public PublicationTransportHandler(TransportService transportService, NamedWriteableRegistry namedWriteableRegistry, Function<PublishRequest, PublishWithJoinResponse> handlePublishRequest)
-
-
Method Details
-
stats
-
newPublicationContext
public PublicationTransportHandler.PublicationContext newPublicationContext(ClusterStatePublicationEvent clusterStatePublicationEvent)
-