Interface RaftModelFactory


public interface RaftModelFactory
Used for creating RaftModel objects with the builder pattern.

Users of MicroRaft can provide an implementation of this interface while creating RaftNode instances. Otherwise, DefaultRaftModelFactory is used. RaftModel objects created by a Raft model factory implementation are passed to Transport for networking, and RaftStore for persistence.

A RaftModelFactory implementation can implement RaftNodeLifecycleAware to perform initialization and clean up work during RaftNode startup and termination. RaftNode calls RaftNodeLifecycleAware.onRaftNodeStart() before calling any other method on RaftModelFactory, and finally calls RaftNodeLifecycleAware.onRaftNodeTerminate() on termination.

  • Method Details

    • createLogEntryBuilder

      @Nonnull io.microraft.model.log.LogEntry.LogEntryBuilder createLogEntryBuilder()
    • createSnapshotEntryBuilder

      @Nonnull io.microraft.model.log.SnapshotEntry.SnapshotEntryBuilder createSnapshotEntryBuilder()
    • createSnapshotChunkBuilder

      @Nonnull io.microraft.model.log.SnapshotChunk.SnapshotChunkBuilder createSnapshotChunkBuilder()
    • createAppendEntriesRequestBuilder

      @Nonnull io.microraft.model.message.AppendEntriesRequest.AppendEntriesRequestBuilder createAppendEntriesRequestBuilder()
    • createAppendEntriesSuccessResponseBuilder

      @Nonnull io.microraft.model.message.AppendEntriesSuccessResponse.AppendEntriesSuccessResponseBuilder createAppendEntriesSuccessResponseBuilder()
    • createAppendEntriesFailureResponseBuilder

      @Nonnull io.microraft.model.message.AppendEntriesFailureResponse.AppendEntriesFailureResponseBuilder createAppendEntriesFailureResponseBuilder()
    • createInstallSnapshotRequestBuilder

      @Nonnull io.microraft.model.message.InstallSnapshotRequest.InstallSnapshotRequestBuilder createInstallSnapshotRequestBuilder()
    • createInstallSnapshotResponseBuilder

      @Nonnull io.microraft.model.message.InstallSnapshotResponse.InstallSnapshotResponseBuilder createInstallSnapshotResponseBuilder()
    • createPreVoteRequestBuilder

      @Nonnull io.microraft.model.message.PreVoteRequest.PreVoteRequestBuilder createPreVoteRequestBuilder()
    • createPreVoteResponseBuilder

      @Nonnull io.microraft.model.message.PreVoteResponse.PreVoteResponseBuilder createPreVoteResponseBuilder()
    • createTriggerLeaderElectionRequestBuilder

      @Nonnull io.microraft.model.message.TriggerLeaderElectionRequest.TriggerLeaderElectionRequestBuilder createTriggerLeaderElectionRequestBuilder()
    • createVoteRequestBuilder

      @Nonnull io.microraft.model.message.VoteRequest.VoteRequestBuilder createVoteRequestBuilder()
    • createVoteResponseBuilder

      @Nonnull io.microraft.model.message.VoteResponse.VoteResponseBuilder createVoteResponseBuilder()
    • createUpdateRaftGroupMembersOpBuilder

      @Nonnull io.microraft.model.groupop.UpdateRaftGroupMembersOp.UpdateRaftGroupMembersOpBuilder createUpdateRaftGroupMembersOpBuilder()
    • createRaftGroupMembersViewBuilder

      @Nonnull io.microraft.model.log.RaftGroupMembersView.RaftGroupMembersViewBuilder createRaftGroupMembersViewBuilder()
    • createRaftEndpointPersistentStateBuilder

      @Nonnull io.microraft.model.persistence.RaftEndpointPersistentState.RaftEndpointPersistentStateBuilder createRaftEndpointPersistentStateBuilder()
    • createRaftTermPersistentStateBuilder

      @Nonnull io.microraft.model.persistence.RaftTermPersistentState.RaftTermPersistentStateBuilder createRaftTermPersistentStateBuilder()