raft: Config: comment wrapping @ 80col

This commit is contained in:
Peter Bourgon 2016-03-01 09:54:58 +01:00
parent 6c1b3a71db
commit aedf2c5876

View File

@ -58,12 +58,10 @@ type Config struct {
// ID is the identity of the local raft. ID cannot be 0. // ID is the identity of the local raft. ID cannot be 0.
ID uint64 ID uint64
// peers contains the IDs of all nodes (including self) in // peers contains the IDs of all nodes (including self) in the raft cluster. It
// the raft cluster. It should only be set when starting a new // should only be set when starting a new raft cluster. Restarting raft from
// raft cluster. // previous configuration will panic if peers is set. peer is private and only
// Restarting raft from previous configuration will panic if // used for testing right now.
// peers is set.
// peer is private and only used for testing right now.
peers []uint64 peers []uint64
// ElectionTick is the number of Node.Tick invocations that must pass between // ElectionTick is the number of Node.Tick invocations that must pass between
@ -78,35 +76,36 @@ type Config struct {
// leadership every HeartbeatTick ticks. // leadership every HeartbeatTick ticks.
HeartbeatTick int HeartbeatTick int
// Storage is the storage for raft. raft generates entries and // Storage is the storage for raft. raft generates entries and states to be
// states to be stored in storage. raft reads the persisted entries // stored in storage. raft reads the persisted entries and states out of
// and states out of Storage when it needs. raft reads out the previous // Storage when it needs. raft reads out the previous state and configuration
// state and configuration out of storage when restarting. // out of storage when restarting.
Storage Storage Storage Storage
// Applied is the last applied index. It should only be set when restarting // Applied is the last applied index. It should only be set when restarting
// raft. raft will not return entries to the application smaller or equal to Applied. // raft. raft will not return entries to the application smaller or equal to
// If Applied is unset when restarting, raft might return previous applied entries. // Applied. If Applied is unset when restarting, raft might return previous
// This is a very application dependent configuration. // applied entries. This is a very application dependent configuration.
Applied uint64 Applied uint64
// MaxSizePerMsg limits the max size of each append message. Smaller value lowers // MaxSizePerMsg limits the max size of each append message. Smaller value
// the raft recovery cost(initial probing and message lost during normal operation). // lowers the raft recovery cost(initial probing and message lost during normal
// On the other side, it might affect the throughput during normal replication. // operation). On the other side, it might affect the throughput during normal
// Note: math.MaxUint64 for unlimited, 0 for at most one entry per message. // replication. Note: math.MaxUint64 for unlimited, 0 for at most one entry per
// message.
MaxSizePerMsg uint64 MaxSizePerMsg uint64
// MaxInflightMsgs limits the max number of in-flight append messages during optimistic // MaxInflightMsgs limits the max number of in-flight append messages during
// replication phase. The application transportation layer usually has its own sending // optimistic replication phase. The application transportation layer usually
// buffer over TCP/UDP. Setting MaxInflightMsgs to avoid overflowing that sending buffer. // has its own sending buffer over TCP/UDP. Setting MaxInflightMsgs to avoid
// TODO (xiangli): feedback to application to limit the proposal rate? // overflowing that sending buffer. TODO (xiangli): feedback to application to
// limit the proposal rate?
MaxInflightMsgs int MaxInflightMsgs int
// CheckQuorum specifies if the leader should check quorum activity. Leader steps down when // CheckQuorum specifies if the leader should check quorum activity. Leader
// quorum is not active for an electionTimeout. // steps down when quorum is not active for an electionTimeout.
CheckQuorum bool CheckQuorum bool
// Logger is the logger used for raft log. For multinode which // Logger is the logger used for raft log. For multinode which can host
// can host multiple raft group, each raft group can have its // multiple raft group, each raft group can have its own logger
// own logger
Logger Logger Logger Logger
} }