public static interface StateMachine.EventApi
| 限定符和类型 | 字段和说明 |
|---|---|
static StateMachine.EventApi |
DEFAULT
A noop implementation of
StateMachine.EventApi. |
| 限定符和类型 | 方法和说明 |
|---|---|
default void |
notifyConfigurationChanged(long term,
long index,
org.apache.ratis.proto.RaftProtos.RaftConfigurationProto newRaftConfiguration)
Notify the
StateMachine a configuration change. |
default void |
notifyGroupRemove()
Notify the
StateMachine a group removal event. |
default void |
notifyLeaderChanged(RaftGroupMemberId groupMemberId,
RaftPeerId newLeaderId)
Notify the
StateMachine that a new leader has been elected. |
default void |
notifyLogFailed(Throwable cause,
org.apache.ratis.proto.RaftProtos.LogEntryProto failedEntry)
Notify the
StateMachine that a log operation failed. |
default void |
notifyServerShutdown(org.apache.ratis.proto.RaftProtos.RoleInfoProto roleInfo)
已过时。
|
default void |
notifyServerShutdown(org.apache.ratis.proto.RaftProtos.RoleInfoProto roleInfo,
boolean allServer)
Notify the
StateMachine that either the server for this division or all the servers have been shut down. |
default void |
notifySnapshotInstalled(org.apache.ratis.proto.RaftProtos.InstallSnapshotResult result,
long snapshotIndex,
RaftPeer peer)
Notify the
StateMachine that the progress of install snapshot is
completely done. |
default void |
notifyTermIndexUpdated(long term,
long index)
Notify the
StateMachine a term-index update event. |
static final StateMachine.EventApi DEFAULT
StateMachine.EventApi.default void notifyLeaderChanged(RaftGroupMemberId groupMemberId, RaftPeerId newLeaderId)
StateMachine that a new leader has been elected.
Note that the new leader can possibly be this server.groupMemberId - The id of this server.newLeaderId - The id of the new leader.default void notifyTermIndexUpdated(long term,
long index)
StateMachine a term-index update event.
This method will be invoked when a RaftProtos.MetadataProto
or RaftProtos.RaftConfigurationProto is processed.
For RaftProtos.StateMachineLogEntryProto, this method will not be invoked.term - The term of the log entryindex - The index of the log entrydefault void notifyConfigurationChanged(long term,
long index,
org.apache.ratis.proto.RaftProtos.RaftConfigurationProto newRaftConfiguration)
StateMachine a configuration change.
This method will be invoked when a RaftProtos.RaftConfigurationProto is processed.term - term of the current log entryindex - index which is being updatednewRaftConfiguration - new configurationdefault void notifyGroupRemove()
StateMachine a group removal event.
This method is invoked after all the pending transactions have been applied by the StateMachine.default void notifyLogFailed(Throwable cause, org.apache.ratis.proto.RaftProtos.LogEntryProto failedEntry)
StateMachine that a log operation failed.cause - The cause of the failure.failedEntry - The failed log entry, if there is any.default void notifySnapshotInstalled(org.apache.ratis.proto.RaftProtos.InstallSnapshotResult result, long snapshotIndex, RaftPeer peer)
StateMachine that the progress of install snapshot is
completely done. Could trigger the cleanup of snapshots.result - RaftProtos.InstallSnapshotResultsnapshotIndex - the index of installed snapshotpeer - the peer who installed the snapshot@Deprecated default void notifyServerShutdown(org.apache.ratis.proto.RaftProtos.RoleInfoProto roleInfo)
StateMachine that the server for this division has been shut down.default void notifyServerShutdown(org.apache.ratis.proto.RaftProtos.RoleInfoProto roleInfo, boolean allServer)
StateMachine that either the server for this division or all the servers have been shut down.roleInfo - roleInfo this serverallServer - whether all raft servers will be shutdown at this timeCopyright © 2017–2025 The Apache Software Foundation. All rights reserved.