Package org.elasticsearch.discovery.zen
Class PublishClusterStateAction
- java.lang.Object
-
- org.elasticsearch.discovery.zen.PublishClusterStateAction
-
public class PublishClusterStateAction extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classPublishClusterStateAction.CommitClusterStateRequeststatic interfacePublishClusterStateAction.IncomingClusterStateListener
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOMMIT_ACTION_NAMEstatic java.lang.StringSEND_ACTION_NAME
-
Constructor Summary
Constructors Constructor Description PublishClusterStateAction(TransportService transportService, NamedWriteableRegistry namedWriteableRegistry, PublishClusterStateAction.IncomingClusterStateListener incomingClusterStateListener, DiscoverySettings discoverySettings)
-
Method Summary
Modifier and Type Method Description protected voidhandleCommitRequest(PublishClusterStateAction.CommitClusterStateRequest request, TransportChannel channel)protected voidhandleIncomingClusterStateRequest(BytesTransportRequest request, TransportChannel channel)voidpublish(ClusterChangedEvent clusterChangedEvent, int minMasterNodes, Discovery.AckListener ackListener)publishes a cluster change event to other nodes.static BytesReferenceserializeDiffClusterState(Diff diff, Version nodeVersion)static BytesReferenceserializeFullClusterState(ClusterState clusterState, Version nodeVersion)PublishClusterStateStatsstats()
-
-
-
Field Detail
-
SEND_ACTION_NAME
public static final java.lang.String SEND_ACTION_NAME
- See Also:
- Constant Field Values
-
COMMIT_ACTION_NAME
public static final java.lang.String COMMIT_ACTION_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PublishClusterStateAction
public PublishClusterStateAction(TransportService transportService, NamedWriteableRegistry namedWriteableRegistry, PublishClusterStateAction.IncomingClusterStateListener incomingClusterStateListener, DiscoverySettings discoverySettings)
-
-
Method Detail
-
publish
public void publish(ClusterChangedEvent clusterChangedEvent, int minMasterNodes, Discovery.AckListener ackListener) throws Discovery.FailedToCommitClusterStateException
publishes a cluster change event to other nodes. if at least minMasterNodes acknowledge the change it is committed and will be processed by the master and the other nodes.The method is guaranteed to throw a
Discovery.FailedToCommitClusterStateExceptionif the change is not committed and should be rejected. Any other exception signals the something wrong happened but the change is committed.
-
serializeFullClusterState
public static BytesReference serializeFullClusterState(ClusterState clusterState, Version nodeVersion) throws java.io.IOException
- Throws:
java.io.IOException
-
serializeDiffClusterState
public static BytesReference serializeDiffClusterState(Diff diff, Version nodeVersion) throws java.io.IOException
- Throws:
java.io.IOException
-
handleIncomingClusterStateRequest
protected void handleIncomingClusterStateRequest(BytesTransportRequest request, TransportChannel channel) throws java.io.IOException
- Throws:
java.io.IOException
-
handleCommitRequest
protected void handleCommitRequest(PublishClusterStateAction.CommitClusterStateRequest request, TransportChannel channel)
-
stats
public PublishClusterStateStats stats()
-
-