|
16 | 16 | * specific language governing permissions and limitations
|
17 | 17 | * under the License.
|
18 | 18 | */
|
19 |
| -package org.elasticsearch.discovery; |
| 19 | +package org.elasticsearch.cluster.coordination; |
20 | 20 |
|
21 | 21 | import org.elasticsearch.action.ActionListener;
|
22 | 22 | import org.elasticsearch.cluster.ClusterChangedEvent;
|
23 | 23 | import org.elasticsearch.cluster.node.DiscoveryNode;
|
24 | 24 | import org.elasticsearch.common.Nullable;
|
25 | 25 | import org.elasticsearch.common.unit.TimeValue;
|
| 26 | +import org.elasticsearch.discovery.FailedToCommitClusterStateException; |
26 | 27 |
|
27 | 28 | public interface ClusterStatePublisher {
|
28 | 29 | /**
|
29 | 30 | * Publish all the changes to the cluster from the master (can be called just by the master). The publish
|
30 | 31 | * process should apply this state to the master as well!
|
31 | 32 | *
|
32 |
| - * The publishListener allows to wait for the publication to go through. |
| 33 | + * The publishListener allows to wait for the publication to complete, which can be either successful completion, timing out or failing. |
| 34 | + * The method is guaranteed to pass back a {@link FailedToCommitClusterStateException} to the publishListener if the change is not |
| 35 | + * committed and should be rejected. Any other exception signals that something bad happened but the change is committed. |
33 | 36 | *
|
34 | 37 | * The {@link AckListener} allows to keep track of the ack received from nodes, and verify whether
|
35 | 38 | * they updated their own cluster state or not.
|
36 |
| - * |
37 |
| - * The method is guaranteed to throw a {@link FailedToCommitClusterStateException} if the change is not committed and should be |
38 |
| - * rejected. Any other exception signals the something wrong happened but the change is committed. |
39 | 39 | */
|
40 | 40 | void publish(ClusterChangedEvent clusterChangedEvent, ActionListener<Void> publishListener, AckListener ackListener);
|
41 | 41 |
|
42 | 42 | interface AckListener {
|
43 | 43 | /**
|
44 |
| - * Should be called when the discovery layer has committed the clusters state (i.e. even if this publication fails, |
| 44 | + * Should be called when the cluster coordination layer has committed the cluster state (i.e. even if this publication fails, |
45 | 45 | * it is guaranteed to appear in future publications).
|
46 | 46 | * @param commitTime the time it took to commit the cluster state
|
47 | 47 | */
|
48 | 48 | void onCommit(TimeValue commitTime);
|
49 | 49 |
|
50 | 50 | /**
|
51 |
| - * Should be called whenever the discovery layer receives confirmation from a node that it has successfully applied |
| 51 | + * Should be called whenever the cluster coordination layer receives confirmation from a node that it has successfully applied |
52 | 52 | * the cluster state. In case of failures, an exception should be provided as parameter.
|
53 | 53 | * @param node the node
|
54 | 54 | * @param e the optional exception
|
|
0 commit comments