Documentation ¶
Index ¶
- Constants
- func GetCopysetsStatus(caller *cobra.Command, copysetIds string, poolIds string) (interface{}, *tablewriter.Table, *cmderror.CmdError, ...)
- func GetLeaderCopysetGap(addr string, key2LeaderInfo *sync.Map, timeout time.Duration) *cmderror.CmdError
- func NewCopysetCommand() *cobra.Command
- type CopysetCommand
- func (cCmd *CopysetCommand) AddFlags()
- func (cCmd *CopysetCommand) Init(cmd *cobra.Command, args []string) error
- func (cCmd *CopysetCommand) Print(cmd *cobra.Command, args []string) error
- func (cCmd *CopysetCommand) ResultPlainOutput() error
- func (cCmd *CopysetCommand) RunCommand(cmd *cobra.Command, args []string) error
- func (cCmd *CopysetCommand) UpdateCopysteGap(timeout time.Duration) *cmderror.CmdError
- type CopysetLeaderInfo
Constants ¶
const ( RAFT_STAT_URL = "/raft_stat" KEY_PATTERN = `\[(\d+)\]` STATE = "state" STATE_PATTERN = `state: ([A-Z]*)` LEADER = "leader" LAST_LOG_ID = "last_log_id" LAST_LOG_ID_PATTERN = `last_log_id: \(index=([0-9]*),term=([0-9]*)\)` REPLICATOR = "replicator" NEXT_INDEX = "next_index" NEXT_INDEX_PATTERN = `next_index=([0-9]*)` FLYING = "flying_append_entries_size" FLYING_PATTERN = `flying_append_entries_size=([0-9]*)` SNAPSHOT = "installing snapshot" )
Variables ¶
This section is empty.
Functions ¶
func GetCopysetsStatus ¶
func GetCopysetsStatus(caller *cobra.Command, copysetIds string, poolIds string) (interface{}, *tablewriter.Table, *cmderror.CmdError, cobrautil.ClUSTER_HEALTH_STATUS)
func GetLeaderCopysetGap ¶
func GetLeaderCopysetGap(addr string, key2LeaderInfo *sync.Map, timeout time.Duration) *cmderror.CmdError
get the gap of the leader copyset located in addr return copysetKety to gap looks like: [4294967297] peer_id: 10.219.192.50:6801:0 state: FOLLOWER readonly: 0 term: 4 conf_index: 4 peers: 10.219.192.50:6800:0 10.219.192.50:6801:0 10.219.192.50:6802:0 leader: 10.219.192.50:6800:0 last_msg_to_now: 81 election_timer: timeout(1000ms) SCHEDULING(in 1018ms) vote_timer: timeout(1000ms) STOPPED stepdown_timer: timeout(1000ms) STOPPED snapshot_timer: timeout(300000ms) SCHEDULING(in 40598ms) storage: [5, 4] disk_index: 4 known_applied_index: 4 last_log_id: (index=4,term=4) state_machine: Idle last_committed_index: 4 last_snapshot_index: 4 last_snapshot_term: 4 snapshot_status: IDLE
[4294967302] peer_id: 10.219.192.50:6801:0 state: LEADER readonly: 0 term: 3 conf_index: 3 peers: 10.219.192.50:6800:0 10.219.192.50:6801:0 10.219.192.50:6802:0 changing_conf: NO stage: STAGE_NONE election_timer: timeout(1000ms) STOPPED vote_timer: timeout(1000ms) STOPPED stepdown_timer: timeout(1000ms) SCHEDULING(in 0ms) snapshot_timer: timeout(300000ms) SCHEDULING(in 36623ms) storage: [4, 3] disk_index: 3 known_applied_index: 3 last_log_id: (index=3,term=3) state_machine: Idle last_committed_index: 3 last_snapshot_index: 3 last_snapshot_term: 3 snapshot_status: IDLE replicator_3298534883333@10.219.192.50:6800:0: next_index=4 flying_append_entries_size=0 idle hc=150785 ac=2 ic=0 replicator_2203318222854@10.219.192.50:6802:0: next_index=4 flying_append_entries_size=0 idle hc=150785 ac=2 ic=0
func NewCopysetCommand ¶
Types ¶
type CopysetCommand ¶
type CopysetCommand struct { basecmd.FinalCurveCmd // contains filtered or unexported fields }
func NewCheckCopysetCommand ¶
func NewCheckCopysetCommand() *CopysetCommand
func (*CopysetCommand) AddFlags ¶
func (cCmd *CopysetCommand) AddFlags()
func (*CopysetCommand) Init ¶
func (cCmd *CopysetCommand) Init(cmd *cobra.Command, args []string) error
func (*CopysetCommand) Print ¶
func (cCmd *CopysetCommand) Print(cmd *cobra.Command, args []string) error
func (*CopysetCommand) ResultPlainOutput ¶
func (cCmd *CopysetCommand) ResultPlainOutput() error
func (*CopysetCommand) RunCommand ¶
func (cCmd *CopysetCommand) RunCommand(cmd *cobra.Command, args []string) error
func (*CopysetCommand) UpdateCopysteGap ¶
func (cCmd *CopysetCommand) UpdateCopysteGap(timeout time.Duration) *cmderror.CmdError
type CopysetLeaderInfo ¶
func NewCopysetLeaderInfo ¶
func NewCopysetLeaderInfo() *CopysetLeaderInfo