Package io.microraft

Class RaftConfig.RaftConfigBuilder

java.lang.Object
io.microraft.RaftConfig.RaftConfigBuilder
Enclosing class:
RaftConfig

public static final class RaftConfig.RaftConfigBuilder extends Object
Builder for Raft config
  • Method Details

    • setLeaderElectionTimeoutMillis

      public RaftConfig.RaftConfigBuilder setLeaderElectionTimeoutMillis(long leaderElectionTimeoutMillis)
      Parameters:
      leaderElectionTimeoutMillis - the leader election timeout in milliseconds value to set
      Returns:
      the builder object for fluent calls
      See Also:
      • RaftConfig.leaderElectionTimeoutMillis
    • setLeaderHeartbeatTimeoutSecs

      public RaftConfig.RaftConfigBuilder setLeaderHeartbeatTimeoutSecs(long leaderHeartbeatTimeoutSecs)
      Parameters:
      leaderHeartbeatTimeoutSecs - the leader heartbeat timeout in seconds value to set
      Returns:
      the builder object for fluent calls
      See Also:
      • RaftConfig.leaderHeartbeatTimeoutSecs
    • setLeaderHeartbeatPeriodSecs

      public RaftConfig.RaftConfigBuilder setLeaderHeartbeatPeriodSecs(long leaderHeartbeatPeriodSecs)
      Parameters:
      leaderHeartbeatPeriodSecs - the leader heartbeat period in seconds value to set
      Returns:
      the builder object for fluent calls
      See Also:
      • RaftConfig.leaderHeartbeatPeriodSecs
    • setAppendEntriesRequestBatchSize

      public RaftConfig.RaftConfigBuilder setAppendEntriesRequestBatchSize(int appendEntriesRequestBatchSize)
      Parameters:
      appendEntriesRequestBatchSize - the append entries request batch size value to set
      Returns:
      the builder object for fluent calls
      See Also:
      • RaftConfig.appendEntriesRequestBatchSize
    • setCommitCountToTakeSnapshot

      public RaftConfig.RaftConfigBuilder setCommitCountToTakeSnapshot(int commitCountToTakeSnapshot)
      Parameters:
      commitCountToTakeSnapshot - the commit count to take snapshot value to set
      Returns:
      the builder object for fluent calls
      See Also:
      • RaftConfig.commitCountToTakeSnapshot
    • setMaxPendingLogEntryCount

      public RaftConfig.RaftConfigBuilder setMaxPendingLogEntryCount(int maxPendingLogEntryCount)
      Parameters:
      maxPendingLogEntryCount - the max pending log entry count value to set
      Returns:
      the builder object for fluent calls
      See Also:
      • RaftConfig.maxPendingLogEntryCount
    • setTransferSnapshotsFromFollowersEnabled

      public RaftConfig.RaftConfigBuilder setTransferSnapshotsFromFollowersEnabled(boolean transferSnapshotsFromFollowersEnabled)
      Parameters:
      transferSnapshotsFromFollowersEnabled - the transfer snapshot from followers value to set
      Returns:
      the builder object for fluent calls
      See Also:
      • transferSnapshotsFromFollowersEnabled
    • setRaftNodeReportPublishPeriodSecs

      public RaftConfig.RaftConfigBuilder setRaftNodeReportPublishPeriodSecs(int raftNodeReportPublishPeriodSecs)
      Parameters:
      raftNodeReportPublishPeriodSecs - the raft node report publish period value to set
      Returns:
      the builder object for fluent calls
      See Also:
      • raftNodeReportPublishPeriodSecs
    • build

      public RaftConfig build()
      Builds the RaftConfig object.
      Returns:
      the RaftConfig object.
    • toString

      public String toString()
      Overrides:
      toString in class Object