代码拉取完成,页面将自动刷新
package raft
// Context represents the current state of the server. It is passed into
// a command when the command is being applied since the server methods
// are locked.
type Context interface {
Server() Server
CurrentTerm() uint64
CurrentIndex() uint64
CommitIndex() uint64
}
// context is the concrete implementation of Context.
type context struct {
server Server
currentIndex uint64
currentTerm uint64
commitIndex uint64
}
// Server returns a reference to the server.
func (c *context) Server() Server {
return c.server
}
// CurrentTerm returns current term the server is in.
func (c *context) CurrentTerm() uint64 {
return c.currentTerm
}
// CurrentIndex returns current index the server is at.
func (c *context) CurrentIndex() uint64 {
return c.currentIndex
}
// CommitIndex returns last commit index the server is at.
func (c *context) CommitIndex() uint64 {
return c.commitIndex
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。