Documentation
¶
Index ¶
- Constants
- Variables
- type Bat
- type KV
- type Lock
- type Node
- func (n *Node) AddNode(address string) error
- func (n *Node) Close() (err error)
- func (n *Node) Command(cmd []byte) (err error)
- func (n *Node) GetLeaderId() (s string, i int64)
- func (n *Node) GetLocalMemMultiValue(key []byte) (value [][]byte)
- func (n *Node) GetLocalMemMultiValueList(key [][]byte) (result [][2][]byte)
- func (n *Node) GetLocalMemValue(key []byte) (value []byte)
- func (n *Node) GetLocalMemValueList(key [][]byte) (result [][2][]byte)
- func (n *Node) GetLocalValue(key []byte) (value []byte, err error)
- func (n *Node) GetLocalValueList(key [][]byte) (result [][2][]byte, err error)
- func (n *Node) GetMemMultiValue(key []byte) (value [][]byte, err error)
- func (n *Node) GetMemValue(key []byte) (value []byte, err error)
- func (n *Node) GetMemValueList(keys [][]byte) (result [][2][]byte, err error)
- func (n *Node) GetMetrics() *raft.Metrics
- func (n *Node) GetMultiValueList(keys [][]byte) (result [][2][]byte, err error)
- func (n *Node) GetNodeId() int64
- func (n *Node) GetNodeTime() (int64, int64)
- func (n *Node) GetPeerInfo() map[string]int64
- func (n *Node) GetPeers() []string
- func (n *Node) GetState() raft.STATE
- func (n *Node) GetTerm() int64
- func (n *Node) GetValue(key []byte) (value []byte, err error)
- func (n *Node) GetValueList(key [][]byte) (result [][2][]byte, err error)
- func (n *Node) LastCommitTxId() int64
- func (n *Node) LastTransactionId() int64
- func (n *Node) LogStoreBatchDel(fromId, toId int64) error
- func (n *Node) LogStoreDel(logId int64) error
- func (n *Node) LogStoreGet(logId int64) *stub.LogEntryBat
- func (n *Node) LogStoreMaxId() int64
- func (n *Node) MemCommand(key, value []byte, ttl uint64, ptype raft.MTYPE) (err error)
- func (n *Node) MemLen() int64
- func (n *Node) Open() (err error)
- func (n *Node) RemoveByAddr(addr string) (r bool)
- func (n *Node) RemoveById(nodeId int64) (r bool)
- func (n *Node) RemoveNode(address string) bool
- func (n *Node) RemoveRx(fromId, toId int64) error
- func (n *Node) RestoreSnapshot(snapshotData []byte) (err error)
- func (n *Node) Running() bool
- func (n *Node) SetId(id int64) (prev int64)
- func (n *Node) StateMachineGetRx(rxId int64) (*stub.MvccCell, error)
- func (n *Node) String() string
- func (n *Node) TakeSnapshot(fromTransactionId, toTransactionId int64) (r []byte, err error)
- func (n *Node) UnWatch(key []byte)
- func (n *Node) UnWatchWithType(key []byte, wt raft.WatchType)
- func (n *Node) WaitRun() error
- func (n *Node) Watch(key []byte, watchTypes []raft.WatchType, isSync bool, ...)
Constants ¶
View Source
const ( GRANTED_OK int32 = 1 GRANTED_TERM_OLD int32 = 2 GRANTED_ID_LITTLE int32 = 3 GRANTED_DATA_OLD int32 = 4 GRANTED_LEADER_ALIVE int32 = 5 GRANTED_VOTEOTHER int32 = 6 )
View Source
const ( HEARTBEAT_OK int32 = 1 HEARTBEAT_TERM_OLD int32 = 2 HEARTBEAT_PARTITION int32 = 3 )
View Source
const ( NODEINFO_SYNCID int32 = 1 NODEINFO_ADDPEER int32 = 2 NODEINFO_DELPEER int32 = 3 NODEINFO_NOTIFY int32 = 4 )
View Source
const ( SYNC_OK int32 = 1 SYNC_NOTFOUND int32 = 2 SYNC_NOT_LEADER int32 = 3 SYNC_ERROR int32 = 4 SYNC_PREPARE int32 = 5 )
View Source
const ( SYNCTYPE_MISS int32 = 1 SYNCTYPE_EMPTY int32 = 2 SYNCTYPE_EXIST int32 = 3 )
View Source
const ( SYSVAR byte = 1 RX byte = 2 LOG byte = 3 ROLLBACK byte = 4 TOROLLBACK byte = 5 )
View Source
const ( Ping byte Pong Chap ChapAck Auth AuthAck Vote VoteAck Commit CommitAck RollBack RollBackAck AppendEntries AppendEntriesAck ReqLogEntries ReqLogEntriesAck HeartBeat HeartBeatAck Proxy ProxyAck NodeInfo NodeInfoAck ProxyRead ProxyReadAck RxSync RxSyncAck MemApply MemApplyAck MemSync MemSyncAck MemProxy MemProxyAck MemProxyRead MemProxyReadAck )
View Source
const ( KEYSYS keySys = 0 KEY key = 0 )
Variables ¶
View Source
var ( TERM = []byte("TERM") NODEID = []byte("NODE_ID") RX_EXEC_CURSOR = []byte("RX_EXEC_CURSOR") RX_MAX_ID = []byte("RX_MAX_ID") RX_TOTAL = []byte("RX_TOTAL") LOG_MAX_ID = []byte("LOG_MAX_ID") ROLLBACK_INCREMENT = []byte("ROLLBACK_INCREMENT") ROLLBACK_CURSOR = []byte("ROLLBACK_CURSOR") TOROLLBACK_INCREMENT = []byte("TOROLLBACK_INCREMENT") TOROLLBACK_CURSOR = []byte("TOROLLBACK_CURSOR") TOROLLBACK_MAX = []byte("TOROLLBACK_MAX") )
Functions ¶
This section is empty.
Types ¶
type Lock ¶
type Lock struct {
FollowerTl sync.Mutex
CandidateTl sync.Mutex
LeaderTl sync.Mutex
VoteTl sync.Mutex
SyncDataTl sync.Mutex
RollBackTl sync.Mutex
ToRollBackTl sync.Mutex
PeercsMux sync.Mutex
HeartBeatMux sync.Mutex
VoteSyncMux sync.Mutex
RollBackMux sync.Mutex
ToRollBackMux sync.Mutex
NodeInfoMux sync.Mutex
MemMux sync.RWMutex
MemSyncMux sync.Mutex
RaftxSyncMux sync.Mutex
RxTotalTL sync.Mutex
RxCustorTL sync.Mutex
// contains filtered or unexported fields
}
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a single node in a Raft cluster, encapsulating the core logic for consensus.
func (*Node) GetLeaderId ¶
func (*Node) GetLocalMemMultiValue ¶
func (*Node) GetLocalMemMultiValueList ¶
func (*Node) GetLocalMemValue ¶
func (*Node) GetLocalMemValueList ¶
func (*Node) GetLocalValueList ¶
func (*Node) GetMemMultiValue ¶
func (*Node) GetMemValueList ¶
func (*Node) GetMetrics ¶
func (*Node) GetMultiValueList ¶
func (*Node) GetNodeTime ¶
func (*Node) GetPeerInfo ¶
func (*Node) GetValueList ¶
func (*Node) LastCommitTxId ¶
LastCommitTxId The transaction ID has been committed
func (*Node) LastTransactionId ¶
LastTransactionId last transaction ID
func (*Node) LogStoreBatchDel ¶
func (*Node) LogStoreDel ¶
func (*Node) LogStoreGet ¶
func (n *Node) LogStoreGet(logId int64) *stub.LogEntryBat
func (*Node) LogStoreMaxId ¶
func (*Node) MemCommand ¶
func (*Node) RemoveByAddr ¶
func (*Node) RemoveById ¶
func (*Node) RemoveNode ¶
func (*Node) RestoreSnapshot ¶
func (*Node) StateMachineGetRx ¶
func (*Node) TakeSnapshot ¶
Click to show internal directories.
Click to hide internal directories.