Documentation ¶
Index ¶
- Constants
- Variables
- func FormatAofId(aofId [16]byte) string
- func InitLogger(config *ServerConfig) (logging.Logger, error)
- func ParseAofId(aofIdString string) ([16]byte, error)
- func SetConfig(config *ServerConfig)
- type Admin
- type Aof
- func (self *Aof) AppendLock(aofLock *AofLock) bool
- func (self *Aof) Close()
- func (self *Aof) CloseAofChannel(aofChannel *AofChannel) *AofChannel
- func (self *Aof) ExecuteConsistencyBarrierCommand(commandType uint8) bool
- func (self *Aof) FindAofFiles() ([]string, string, error)
- func (self *Aof) Flush()
- func (self *Aof) FlushWithLocked()
- func (self *Aof) GetCurrentAofID() [16]byte
- func (self *Aof) Init() ([16]byte, error)
- func (self *Aof) Load() error
- func (self *Aof) LoadAndInit() error
- func (self *Aof) LoadAofFile(filename string, lock *AofLock, expriedTime int64, ...) error
- func (self *Aof) LoadAofFiles(filenames []string, expriedTime int64, ...) error
- func (self *Aof) LoadFileMaxAofLock(filename string) (*AofLock, error)
- func (self *Aof) LoadLock(aofLock *AofLock) error
- func (self *Aof) LoadMaxAofId() ([16]byte, error)
- func (self *Aof) NewAofChannel(lockDb *LockDB, lockDbGlockIndex uint16, lockDbGlock *PriorityMutex) *AofChannel
- func (self *Aof) OpenAofFile(aofIndex uint32) (*AofFile, error)
- func (self *Aof) PushLock(glockIndex uint16, aofLock *AofLock) error
- func (self *Aof) RemoveAofChannel(aofChannel *AofChannel) *AofChannel
- func (self *Aof) ReplayLock(aofLock *AofLock) error
- func (self *Aof) Reset(aofFileIndex uint32, aofFileOffset uint32) error
- func (self *Aof) RewriteAofFile(startRewite bool) error
- func (self *Aof) WaitFlushAofChannel() error
- func (self *Aof) WaitRewriteAofFiles() error
- type AofChannel
- func (self *AofChannel) Acked(commandResult *protocol.LockResultCommand) error
- func (self *AofChannel) AofAcked(buf []byte, succed bool) error
- func (self *AofChannel) Handle(aofLock *AofLock)
- func (self *AofChannel) HandleAcked(aofLock *AofLock)
- func (self *AofChannel) HandleAofAcked(aofLock *AofLock)
- func (self *AofChannel) HandleConsistencyBarrierCommand(aofLock *AofLock)
- func (self *AofChannel) HandleLoad(aofLock *AofLock)
- func (self *AofChannel) HandleLock(aofLock *AofLock)
- func (self *AofChannel) HandleReplay(aofLock *AofLock)
- func (self *AofChannel) Load(fromAofLock *AofLock) error
- func (self *AofChannel) Push(dbId uint8, lock *Lock, commandType uint8, lockCommand *protocol.LockCommand, ...) error
- func (self *AofChannel) Replay(fromAofLock *AofLock) error
- func (self *AofChannel) Run()
- type AofFile
- func (self *AofFile) AppendLock(lock *AofLock) error
- func (self *AofFile) Close() error
- func (self *AofFile) Flush() error
- func (self *AofFile) GetSize() int
- func (self *AofFile) Open() error
- func (self *AofFile) ReadHeader() error
- func (self *AofFile) ReadLock(lock *AofLock) error
- func (self *AofFile) ReadLockData(lock *AofLock) error
- func (self *AofFile) ReadTail(lock *AofLock) error
- func (self *AofFile) Sync() error
- func (self *AofFile) WriteHeader() error
- func (self *AofFile) WriteLock(lock *AofLock) error
- func (self *AofFile) WriteLockData(lock *AofLock) error
- type AofLock
- type AofLockQueue
- type ArbiterClient
- type ArbiterManager
- func (self *ArbiterManager) AddMember(host string, weight uint32, arbiter uint32) error
- func (self *ArbiterManager) Close() error
- func (self *ArbiterManager) CompareAofId(a [16]byte, b [16]byte) int
- func (self *ArbiterManager) Config(host string, weight uint32, arbiter uint32) error
- func (self *ArbiterManager) DecodeAofId(aofIdString string) [16]byte
- func (self *ArbiterManager) DoAnnouncement()
- func (self *ArbiterManager) EncodeAofId(aofId [16]byte) string
- func (self *ArbiterManager) GetCallMethods() map[string]BinaryServerProtocolCallHandler
- func (self *ArbiterManager) GetCurrentAofID() [16]byte
- func (self *ArbiterManager) GetMajorityMemberCount() int
- func (self *ArbiterManager) GetMembers() []*ArbiterMember
- func (self *ArbiterManager) Load() error
- func (self *ArbiterManager) QuitLeader() error
- func (self *ArbiterManager) QuitMember() error
- func (self *ArbiterManager) RemoveMember(host string) error
- func (self *ArbiterManager) Start() error
- func (self *ArbiterManager) StartVote() error
- func (self *ArbiterManager) UpdateMember(host string, weight uint32, arbiter uint32) error
- type ArbiterMember
- func (self *ArbiterMember) Close() error
- func (self *ArbiterMember) DoAnnouncement() (*protobuf.ArbiterAnnouncementResponse, error)
- func (self *ArbiterMember) DoCommit(proposalId uint64, host string, aofId [16]byte) (*protobuf.ArbiterCommitResponse, error)
- func (self *ArbiterMember) DoProposal(proposalId uint64, host string, aofId [16]byte) (*protobuf.ArbiterProposalResponse, error)
- func (self *ArbiterMember) DoVote() (*protobuf.ArbiterVoteResponse, error)
- func (self *ArbiterMember) Open() error
- func (self *ArbiterMember) Run()
- func (self *ArbiterMember) UpdateStatus() error
- func (self *ArbiterMember) Wakeup()
- type ArbiterServer
- type ArbiterStore
- type ArbiterVoter
- func (self *ArbiterVoter) Close() error
- func (self *ArbiterVoter) DoAnnouncement() error
- func (self *ArbiterVoter) DoCommit() error
- func (self *ArbiterVoter) DoProposal() error
- func (self *ArbiterVoter) DoRequests(name string, handler func(*ArbiterMember) (interface{}, error)) []interface{}
- func (self *ArbiterVoter) DoVote() error
- func (self *ArbiterVoter) StartVote() error
- func (self *ArbiterVoter) WakeupRetryVote() error
- type ArbiterVoterSubscriber
- type BinaryServerProtocol
- func (self *BinaryServerProtocol) AddProxy(proxy *ProxyServerProtocol) error
- func (self *BinaryServerProtocol) Close() error
- func (self *BinaryServerProtocol) FindCallMethod(methodName string) (BinaryServerProtocolCallHandler, error)
- func (self *BinaryServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
- func (self *BinaryServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
- func (self *BinaryServerProtocol) GetLockCommand() *protocol.LockCommand
- func (self *BinaryServerProtocol) GetLockCommandLocked() *protocol.LockCommand
- func (self *BinaryServerProtocol) GetProxy() *ProxyServerProtocol
- func (self *BinaryServerProtocol) GetStream() *Stream
- func (self *BinaryServerProtocol) Init(clientId [16]byte) error
- func (self *BinaryServerProtocol) InitLockCommand()
- func (self *BinaryServerProtocol) Lock()
- func (self *BinaryServerProtocol) Process() error
- func (self *BinaryServerProtocol) ProcessBuild(command protocol.ICommand) error
- func (self *BinaryServerProtocol) ProcessCommad(command protocol.ICommand) error
- func (self *BinaryServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
- func (self *BinaryServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *BinaryServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *BinaryServerProtocol) ProcessParse(buf []byte) error
- func (self *BinaryServerProtocol) ProcessParseLockData() (*protocol.LockCommandData, error)
- func (self *BinaryServerProtocol) Read() (protocol.CommandDecode, error)
- func (self *BinaryServerProtocol) ReadCommand() (protocol.CommandDecode, error)
- func (self *BinaryServerProtocol) ReadParse(buf []byte) (protocol.CommandDecode, error)
- func (self *BinaryServerProtocol) RemoteAddr() net.Addr
- func (self *BinaryServerProtocol) UnInitLockCommand()
- func (self *BinaryServerProtocol) Unlock()
- func (self *BinaryServerProtocol) Write(result protocol.CommandEncode) error
- func (self *BinaryServerProtocol) WriteCommand(result protocol.CommandEncode) error
- type BinaryServerProtocolCallHandler
- type DefaultServerProtocol
- func (self *DefaultServerProtocol) AddProxy(_ *ProxyServerProtocol) error
- func (self *DefaultServerProtocol) Close() error
- func (self *DefaultServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
- func (self *DefaultServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
- func (self *DefaultServerProtocol) GetLockCommand() *protocol.LockCommand
- func (self *DefaultServerProtocol) GetLockCommandLocked() *protocol.LockCommand
- func (self *DefaultServerProtocol) GetProxy() *ProxyServerProtocol
- func (self *DefaultServerProtocol) GetStream() *Stream
- func (self *DefaultServerProtocol) Init(_ [16]byte) error
- func (self *DefaultServerProtocol) Lock()
- func (self *DefaultServerProtocol) Process() error
- func (self *DefaultServerProtocol) ProcessBuild(_ protocol.ICommand) error
- func (self *DefaultServerProtocol) ProcessCommad(command protocol.ICommand) error
- func (self *DefaultServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
- func (self *DefaultServerProtocol) ProcessLockResultCommand(_ *protocol.LockCommand, _ uint8, _ uint16, _ uint8, _ []byte) error
- func (self *DefaultServerProtocol) ProcessLockResultCommandLocked(_ *protocol.LockCommand, _ uint8, _ uint16, _ uint8, _ []byte) error
- func (self *DefaultServerProtocol) ProcessParse(_ []byte) error
- func (self *DefaultServerProtocol) Read() (protocol.CommandDecode, error)
- func (self *DefaultServerProtocol) ReadCommand() (protocol.CommandDecode, error)
- func (self *DefaultServerProtocol) RemoteAddr() net.Addr
- func (self *DefaultServerProtocol) Unlock()
- func (self *DefaultServerProtocol) Write(protocol.CommandEncode) error
- func (self *DefaultServerProtocol) WriteCommand(protocol.CommandEncode) error
- type FastKeyValue
- type Lock
- type LockCommandQueue
- func (self *LockCommandQueue) Head() *protocol.LockCommand
- func (self *LockCommandQueue) IterNodeQueues(index int32) []*protocol.LockCommand
- func (self *LockCommandQueue) IterNodes() [][]*protocol.LockCommand
- func (self *LockCommandQueue) Len() int32
- func (self *LockCommandQueue) Pop() *protocol.LockCommand
- func (self *LockCommandQueue) PopRight() *protocol.LockCommand
- func (self *LockCommandQueue) Push(lock *protocol.LockCommand) error
- func (self *LockCommandQueue) PushLeft(lock *protocol.LockCommand) error
- func (self *LockCommandQueue) Rellac() error
- func (self *LockCommandQueue) Reset() error
- func (self *LockCommandQueue) Resize() error
- func (self *LockCommandQueue) Restructuring() error
- func (self *LockCommandQueue) Shrink(size int32) int32
- func (self *LockCommandQueue) Tail() *protocol.LockCommand
- type LockDB
- func (self *LockDB) AddExpried(lock *Lock, lockExpriedTime int64)
- func (self *LockDB) AddMillisecondExpried(lock *Lock)
- func (self *LockDB) AddMillisecondTimeOut(lock *Lock)
- func (self *LockDB) AddTimeOut(lock *Lock, lockTimeoutTime int64)
- func (self *LockDB) CheckProbableLock(serverProtocol ServerProtocol, command *protocol.LockCommand) bool
- func (self *LockDB) Close()
- func (self *LockDB) DoAckLock(lock *Lock, succed bool)
- func (self *LockDB) FlushDB() error
- func (self *LockDB) GetLockManager(command *protocol.LockCommand) *LockManager
- func (self *LockDB) GetOrNewLockManager(command *protocol.LockCommand) *LockManager
- func (self *LockDB) GetState() *protocol.LockDBState
- func (self *LockDB) HasLock(command *protocol.LockCommand, aofLockData []byte) bool
- func (self *LockDB) Lock(serverProtocol ServerProtocol, command *protocol.LockCommand, ...) error
- func (self *LockDB) PushExecutorLockCommand(lockManager *LockManager, serverProtocol ServerProtocol, ...) error
- func (self *LockDB) RemoveExpried(lock *Lock)
- func (self *LockDB) RemoveLockManager(lockManager *LockManager)
- func (self *LockDB) RemoveLongExpried(lock *Lock)
- func (self *LockDB) RemoveLongTimeOut(lock *Lock)
- func (self *LockDB) RemoveTimeOut(lock *Lock)
- func (self *LockDB) UnLock(serverProtocol ServerProtocol, command *protocol.LockCommand, ...) error
- type LockDBExecutor
- type LockDBExecutorTask
- type LockData
- type LockManager
- func (self *LockManager) AddLock(lock *Lock) *Lock
- func (self *LockManager) AddWaitLock(lock *Lock) *Lock
- func (self *LockManager) AofLockData(commandType uint8, lock *Lock) []byte
- func (self *LockManager) FreeLock(lock *Lock) *Lock
- func (self *LockManager) GetDB() *LockDB
- func (self *LockManager) GetLockData() []byte
- func (self *LockManager) GetLockedLock(command *protocol.LockCommand) *Lock
- func (self *LockManager) GetOrNewLock(serverProtocol ServerProtocol, command *protocol.LockCommand) *Lock
- func (self *LockManager) GetWaitLock() *Lock
- func (self *LockManager) ProcessAckLockData(lock *Lock) []byte
- func (self *LockManager) ProcessExecuteLockCommand(lock *Lock, commandStage uint8)
- func (self *LockManager) ProcessLockData(command *protocol.LockCommand, lock *Lock, requireRecover bool)
- func (self *LockManager) ProcessRecoverLockData(lock *Lock)
- func (self *LockManager) PushLockAof(lock *Lock, aofFlag uint16) error
- func (self *LockManager) PushUnLockAof(dbId uint8, lock *Lock, lockCommand *protocol.LockCommand, ...) error
- func (self *LockManager) RemoveLock(lock *Lock) *Lock
- func (self *LockManager) UpdateLockedLock(lock *Lock, timeout uint16, timeout_flag uint16, expried uint16, ...)
- type LockManagerData
- type LockQueue
- func (self *LockQueue) Head() *Lock
- func (self *LockQueue) IterNodeQueues(index int32) []*Lock
- func (self *LockQueue) IterNodes() [][]*Lock
- func (self *LockQueue) Len() int32
- func (self *LockQueue) Pop() *Lock
- func (self *LockQueue) PopRight() *Lock
- func (self *LockQueue) Push(lock *Lock) error
- func (self *LockQueue) PushLeft(lock *Lock) error
- func (self *LockQueue) Rellac() error
- func (self *LockQueue) Reset() error
- func (self *LockQueue) Resize() error
- func (self *LockQueue) Restructuring() error
- func (self *LockQueue) Shrink(size int32) int32
- func (self *LockQueue) Tail() *Lock
- type LongWaitLockFreeQueue
- type LongWaitLockQueue
- type MemWaiterServerProtocol
- func (self *MemWaiterServerProtocol) AddProxy(proxy *ProxyServerProtocol) error
- func (self *MemWaiterServerProtocol) AddWaiter(command *protocol.LockCommand, waiter chan *protocol.LockResultCommand) error
- func (self *MemWaiterServerProtocol) Close() error
- func (self *MemWaiterServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
- func (self *MemWaiterServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
- func (self *MemWaiterServerProtocol) GetLockCommand() *protocol.LockCommand
- func (self *MemWaiterServerProtocol) GetLockCommandLocked() *protocol.LockCommand
- func (self *MemWaiterServerProtocol) GetProxy() *ProxyServerProtocol
- func (self *MemWaiterServerProtocol) GetStream() *Stream
- func (self *MemWaiterServerProtocol) Init(_ [16]byte) error
- func (self *MemWaiterServerProtocol) InitLockCommand()
- func (self *MemWaiterServerProtocol) Lock()
- func (self *MemWaiterServerProtocol) Process() error
- func (self *MemWaiterServerProtocol) ProcessBuild(_ protocol.ICommand) error
- func (self *MemWaiterServerProtocol) ProcessCommad(_ protocol.ICommand) error
- func (self *MemWaiterServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
- func (self *MemWaiterServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *MemWaiterServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *MemWaiterServerProtocol) ProcessParse(_ []byte) error
- func (self *MemWaiterServerProtocol) Read() (protocol.CommandDecode, error)
- func (self *MemWaiterServerProtocol) ReadCommand() (protocol.CommandDecode, error)
- func (self *MemWaiterServerProtocol) RemoteAddr() net.Addr
- func (self *MemWaiterServerProtocol) RemoveWaiter(command *protocol.LockCommand) error
- func (self *MemWaiterServerProtocol) SetResultCallback(callback MemWaiterServerProtocolResultCallback) error
- func (self *MemWaiterServerProtocol) UnInitLockCommand()
- func (self *MemWaiterServerProtocol) Unlock()
- func (self *MemWaiterServerProtocol) Write(protocol.CommandEncode) error
- func (self *MemWaiterServerProtocol) WriteCommand(protocol.CommandEncode) error
- type MemWaiterServerProtocolResultCallback
- type MillisecondWaitLockFreeQueue
- type PriorityMutex
- func (self *PriorityMutex) HighPriorityLock()
- func (self *PriorityMutex) HighPriorityMutexWait()
- func (self *PriorityMutex) HighPriorityUnlock()
- func (self *PriorityMutex) HighSetPriority() bool
- func (self *PriorityMutex) HighUnSetPriority() bool
- func (self *PriorityMutex) Lock()
- func (self *PriorityMutex) LowPriorityLock()
- func (self *PriorityMutex) LowPriorityUnlock()
- func (self *PriorityMutex) LowSetPriority() bool
- func (self *PriorityMutex) LowUnSetPriority() bool
- func (self *PriorityMutex) Unlock()
- type ProxyServerProtocol
- func (self *ProxyServerProtocol) AddProxy(proxyServerProtocol *ProxyServerProtocol) error
- func (self *ProxyServerProtocol) Close() error
- func (self *ProxyServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
- func (self *ProxyServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
- func (self *ProxyServerProtocol) GetLockCommand() *protocol.LockCommand
- func (self *ProxyServerProtocol) GetLockCommandLocked() *protocol.LockCommand
- func (self *ProxyServerProtocol) GetProxy() *ProxyServerProtocol
- func (self *ProxyServerProtocol) GetStream() *Stream
- func (self *ProxyServerProtocol) Init(clientId [16]byte) error
- func (self *ProxyServerProtocol) Lock()
- func (self *ProxyServerProtocol) Process() error
- func (self *ProxyServerProtocol) ProcessBuild(command protocol.ICommand) error
- func (self *ProxyServerProtocol) ProcessCommad(command protocol.ICommand) error
- func (self *ProxyServerProtocol) ProcessLockCommand(command *protocol.LockCommand) error
- func (self *ProxyServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *ProxyServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *ProxyServerProtocol) ProcessParse(buf []byte) error
- func (self *ProxyServerProtocol) Read() (protocol.CommandDecode, error)
- func (self *ProxyServerProtocol) ReadCommand() (protocol.CommandDecode, error)
- func (self *ProxyServerProtocol) RemoteAddr() net.Addr
- func (self *ProxyServerProtocol) Unlock()
- func (self *ProxyServerProtocol) Write(command protocol.CommandEncode) error
- func (self *ProxyServerProtocol) WriteCommand(command protocol.CommandEncode) error
- type PublishLock
- type ReplicationAckDB
- func (self *ReplicationAckDB) Close() error
- func (self *ReplicationAckDB) FlushDB() error
- func (self *ReplicationAckDB) ProcessFollowerAckAofed(glockIndex uint16, aofLock *AofLock) error
- func (self *ReplicationAckDB) ProcessFollowerAckLocked(glockIndex uint16, command *protocol.LockCommand, result uint8, lcount uint16, ...) error
- func (self *ReplicationAckDB) ProcessFollowerPushAckLock(glockIndex uint16, aofLock *AofLock) error
- func (self *ReplicationAckDB) ProcessFollowerPushAckUnLock(glockIndex uint16, aofLock *AofLock) error
- func (self *ReplicationAckDB) ProcessLeaderAcked(glockIndex uint16, aofLock *AofLock) error
- func (self *ReplicationAckDB) ProcessLeaderAofed(glockIndex uint16, aofLock *AofLock) error
- func (self *ReplicationAckDB) ProcessLeaderPushLock(glockIndex uint16, aofLock *AofLock) error
- func (self *ReplicationAckDB) ProcessLeaderPushUnLock(glockIndex uint16, aofLock *AofLock) error
- func (self *ReplicationAckDB) SwitchToFollower() error
- func (self *ReplicationAckDB) SwitchToLeader() error
- type ReplicationAckLock
- type ReplicationBufferQueue
- func (self *ReplicationBufferQueue) AddPoll(cursor *ReplicationBufferQueueCursor)
- func (self *ReplicationBufferQueue) Close() error
- func (self *ReplicationBufferQueue) Head(cursor *ReplicationBufferQueueCursor) error
- func (self *ReplicationBufferQueue) InitFreeQueueItems(count uint64)
- func (self *ReplicationBufferQueue) Pop(cursor *ReplicationBufferQueueCursor) error
- func (self *ReplicationBufferQueue) Push(buf []byte, data []byte) error
- func (self *ReplicationBufferQueue) RemovePoll(cursor *ReplicationBufferQueueCursor)
- func (self *ReplicationBufferQueue) Search(aofId [16]byte, cursor *ReplicationBufferQueueCursor) error
- type ReplicationBufferQueueCursor
- type ReplicationBufferQueueItem
- type ReplicationClient
- func (self *ReplicationClient) Close() error
- func (self *ReplicationClient) HandleAcked(ackLock *ReplicationAckLock) error
- func (self *ReplicationClient) InitSync() error
- func (self *ReplicationClient) Open(addr string) error
- func (self *ReplicationClient) Process() error
- func (self *ReplicationClient) ProcessAofAppend()
- func (self *ReplicationClient) ProcessPushAofLock()
- func (self *ReplicationClient) ProcessReplayLock()
- func (self *ReplicationClient) Run()
- func (self *ReplicationClient) WakeupRetryConnect() error
- type ReplicationClientState
- type ReplicationManager
- func (self *ReplicationManager) ChangeLeader(address string) error
- func (self *ReplicationManager) Close()
- func (self *ReplicationManager) FlushDB() error
- func (self *ReplicationManager) GetAckDB(dbId uint8) *ReplicationAckDB
- func (self *ReplicationManager) GetCallMethods() map[string]BinaryServerProtocolCallHandler
- func (self *ReplicationManager) GetCurrentAofID() [16]byte
- func (self *ReplicationManager) GetHandlers() map[string]TextServerProtocolCommandHandler
- func (self *ReplicationManager) GetOrNewAckDB(dbId uint8) *ReplicationAckDB
- func (self *ReplicationManager) Init(leaderAddress string, aofId [16]byte) error
- func (self *ReplicationManager) PushLock(glockIndex uint16, aofLock *AofLock) error
- func (self *ReplicationManager) StartSync() error
- func (self *ReplicationManager) SwitchToFollower(address string) error
- func (self *ReplicationManager) SwitchToLeader() error
- func (self *ReplicationManager) WaitInitSynced(waiter chan bool)
- func (self *ReplicationManager) WaitServerSynced() error
- func (self *ReplicationManager) WakeupServerChannel() error
- type ReplicationServer
- type ReplicationServerState
- type SLock
- func (self *SLock) Close()
- func (self *SLock) GetAdmin() *Admin
- func (self *SLock) GetAof() *Aof
- func (self *SLock) GetArbiterManager() *ArbiterManager
- func (self *SLock) GetDB(dbId uint8) *LockDB
- func (self *SLock) GetOrNewDB(dbId uint8) *LockDB
- func (self *SLock) GetReplicationManager() *ReplicationManager
- func (self *SLock) GetState(serverProtocol ServerProtocol, command *protocol.StateCommand) error
- func (self *SLock) GetSubscribeManager() *SubscribeManager
- func (self *SLock) Init(server *Server) error
- func (self *SLock) Log() logging.Logger
- func (self *SLock) Start()
- type Server
- type ServerConfig
- type ServerProtocol
- type ServerProtocolSession
- type Stream
- func (self *Stream) Close() error
- func (self *Stream) LocalAddr() net.Addr
- func (self *Stream) Read(buf []byte) (int, error)
- func (self *Stream) ReadBytes(buf []byte) (int, error)
- func (self *Stream) ReadBytesFrame() ([]byte, error)
- func (self *Stream) ReadBytesSize(size int) ([]byte, error)
- func (self *Stream) ReadFromConn(buf []byte) (int, error)
- func (self *Stream) ReadSize(size int) ([]byte, error)
- func (self *Stream) RemoteAddr() net.Addr
- func (self *Stream) SetDeadline(t time.Time) error
- func (self *Stream) SetReadDeadline(t time.Time) error
- func (self *Stream) SetWriteDeadline(t time.Time) error
- func (self *Stream) Write(b []byte) (int, error)
- func (self *Stream) WriteBytes(b []byte) error
- type StreamReaderBuffer
- type SubscribeBuffer
- type SubscribeChannel
- type SubscribeClient
- type SubscribeManager
- func (self *SubscribeManager) ChangeLeader(address string) error
- func (self *SubscribeManager) Close()
- func (self *SubscribeManager) CloseSubscribeChannel(aofChannel *SubscribeChannel) *SubscribeChannel
- func (self *SubscribeManager) NewSubscribeChannel(lockDb *LockDB, lockDbGlockIndex uint16, lockDbGlock *PriorityMutex) *SubscribeChannel
- func (self *SubscribeManager) RemoveSubscribeChannel(aofChannel *SubscribeChannel) *SubscribeChannel
- func (self *SubscribeManager) WaitFlushSubscribeChannel() error
- type SubscribePublishLockQueue
- type Subscriber
- type TextServerProtocol
- func (self *TextServerProtocol) AddProxy(proxy *ProxyServerProtocol) error
- func (self *TextServerProtocol) ArgsToLockComand(args []string) (*protocol.LockCommand, error)
- func (self *TextServerProtocol) ArgsToLockComandParseId(argId string, lockId *[16]byte)
- func (self *TextServerProtocol) Close() error
- func (self *TextServerProtocol) FindHandler(name string) (TextServerProtocolCommandHandler, error)
- func (self *TextServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
- func (self *TextServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
- func (self *TextServerProtocol) GetLockCommand() *protocol.LockCommand
- func (self *TextServerProtocol) GetLockCommandLocked() *protocol.LockCommand
- func (self *TextServerProtocol) GetParser() *protocol.TextParser
- func (self *TextServerProtocol) GetProxy() *ProxyServerProtocol
- func (self *TextServerProtocol) GetRequestId() [16]byte
- func (self *TextServerProtocol) GetStream() *Stream
- func (self *TextServerProtocol) Init(_ [16]byte) error
- func (self *TextServerProtocol) InitLockCommand()
- func (self *TextServerProtocol) Lock()
- func (self *TextServerProtocol) Process() error
- func (self *TextServerProtocol) ProcessBuild(command protocol.ICommand) error
- func (self *TextServerProtocol) ProcessCommad(command protocol.ICommand) error
- func (self *TextServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
- func (self *TextServerProtocol) ProcessLockResultCommand(lockCommand *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *TextServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *TextServerProtocol) ProcessParse(buf []byte) error
- func (self *TextServerProtocol) Read() (protocol.CommandDecode, error)
- func (self *TextServerProtocol) ReadCommand() (protocol.CommandDecode, error)
- func (self *TextServerProtocol) RemoteAddr() net.Addr
- func (self *TextServerProtocol) RunCommand() error
- func (self *TextServerProtocol) UnInitLockCommand()
- func (self *TextServerProtocol) Unlock()
- func (self *TextServerProtocol) Write(result protocol.CommandEncode) error
- func (self *TextServerProtocol) WriteCommand(result protocol.CommandEncode) error
- type TextServerProtocolCommandHandler
- type TransparencyBinaryClientProtocol
- func (self *TransparencyBinaryClientProtocol) Close() error
- func (self *TransparencyBinaryClientProtocol) Open(leaderAddress string) error
- func (self *TransparencyBinaryClientProtocol) Process()
- func (self *TransparencyBinaryClientProtocol) RetryOpen(leaderAddress string) error
- func (self *TransparencyBinaryClientProtocol) Write(command protocol.ICommand) error
- type TransparencyBinaryServerProtocol
- func (self *TransparencyBinaryServerProtocol) AddProxy(proxy *ProxyServerProtocol) error
- func (self *TransparencyBinaryServerProtocol) CheckClient() (*TransparencyBinaryClientProtocol, error)
- func (self *TransparencyBinaryServerProtocol) Close() error
- func (self *TransparencyBinaryServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
- func (self *TransparencyBinaryServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
- func (self *TransparencyBinaryServerProtocol) GetLockCommand() *protocol.LockCommand
- func (self *TransparencyBinaryServerProtocol) GetLockCommandLocked() *protocol.LockCommand
- func (self *TransparencyBinaryServerProtocol) GetProxy() *ProxyServerProtocol
- func (self *TransparencyBinaryServerProtocol) GetStream() *Stream
- func (self *TransparencyBinaryServerProtocol) Init(clientId [16]byte) error
- func (self *TransparencyBinaryServerProtocol) InitLockCommand()
- func (self *TransparencyBinaryServerProtocol) Lock()
- func (self *TransparencyBinaryServerProtocol) Process() error
- func (self *TransparencyBinaryServerProtocol) ProcessBuild(command protocol.ICommand) error
- func (self *TransparencyBinaryServerProtocol) ProcessCommad(command protocol.ICommand) error
- func (self *TransparencyBinaryServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
- func (self *TransparencyBinaryServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *TransparencyBinaryServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *TransparencyBinaryServerProtocol) ProcessParse(buf []byte) error
- func (self *TransparencyBinaryServerProtocol) Read() (protocol.CommandDecode, error)
- func (self *TransparencyBinaryServerProtocol) ReadCommand() (protocol.CommandDecode, error)
- func (self *TransparencyBinaryServerProtocol) RemoteAddr() net.Addr
- func (self *TransparencyBinaryServerProtocol) UnInitLockCommand()
- func (self *TransparencyBinaryServerProtocol) Unlock()
- func (self *TransparencyBinaryServerProtocol) Write(result protocol.CommandEncode) error
- func (self *TransparencyBinaryServerProtocol) WriteCommand(result protocol.CommandEncode) error
- type TransparencyManager
- func (self *TransparencyManager) AcquireClient(serverProtocol ServerProtocol) (*TransparencyBinaryClientProtocol, error)
- func (self *TransparencyManager) ChangeLeader(address string) error
- func (self *TransparencyManager) CheckArbiterWaiter() int
- func (self *TransparencyManager) Close() error
- func (self *TransparencyManager) CloseClient(binaryClient *TransparencyBinaryClientProtocol) error
- func (self *TransparencyManager) OpenClient(initCommand *protocol.InitCommand) (*TransparencyBinaryClientProtocol, error)
- func (self *TransparencyManager) ReleaseClient(binaryClient *TransparencyBinaryClientProtocol) error
- func (self *TransparencyManager) Run()
- func (self *TransparencyManager) Wakeup()
- type TransparencyTextServerProtocol
- func (self *TransparencyTextServerProtocol) AddProxy(proxy *ProxyServerProtocol) error
- func (self *TransparencyTextServerProtocol) CheckClient() (*TransparencyBinaryClientProtocol, error)
- func (self *TransparencyTextServerProtocol) Close() error
- func (self *TransparencyTextServerProtocol) FindHandler(name string) (TextServerProtocolCommandHandler, error)
- func (self *TransparencyTextServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
- func (self *TransparencyTextServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
- func (self *TransparencyTextServerProtocol) GetLockCommand() *protocol.LockCommand
- func (self *TransparencyTextServerProtocol) GetLockCommandLocked() *protocol.LockCommand
- func (self *TransparencyTextServerProtocol) GetParser() *protocol.TextParser
- func (self *TransparencyTextServerProtocol) GetProxy() *ProxyServerProtocol
- func (self *TransparencyTextServerProtocol) GetStream() *Stream
- func (self *TransparencyTextServerProtocol) Init(_ [16]byte) error
- func (self *TransparencyTextServerProtocol) InitLockCommand()
- func (self *TransparencyTextServerProtocol) Lock()
- func (self *TransparencyTextServerProtocol) Process() error
- func (self *TransparencyTextServerProtocol) ProcessBuild(command protocol.ICommand) error
- func (self *TransparencyTextServerProtocol) ProcessCommad(command protocol.ICommand) error
- func (self *TransparencyTextServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
- func (self *TransparencyTextServerProtocol) ProcessLockResultCommand(lockCommand *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *TransparencyTextServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, ...) error
- func (self *TransparencyTextServerProtocol) ProcessParse(buf []byte) error
- func (self *TransparencyTextServerProtocol) Read() (protocol.CommandDecode, error)
- func (self *TransparencyTextServerProtocol) ReadCommand() (protocol.CommandDecode, error)
- func (self *TransparencyTextServerProtocol) RemoteAddr() net.Addr
- func (self *TransparencyTextServerProtocol) RunCommand() error
- func (self *TransparencyTextServerProtocol) UnInitLockCommand()
- func (self *TransparencyTextServerProtocol) Unlock()
- func (self *TransparencyTextServerProtocol) Write(result protocol.CommandEncode) error
- func (self *TransparencyTextServerProtocol) WriteCommand(result protocol.CommandEncode) error
Constants ¶
View Source
const ( STATE_INIT = iota STATE_LEADER STATE_FOLLOWER STATE_SYNC STATE_CONFIG STATE_VOTE STATE_CLOSE )
View Source
const ( STREAM_TYPE_NORMAL uint8 = 0 STREAM_TYPE_AOF uint8 = 1 STREAM_TYPE_ARBITER uint8 = 2 )
View Source
const AOF_FLAG_CONTAINS_DATA = 0x2000
View Source
const AOF_FLAG_EXPRIED = 0x0004
View Source
const AOF_FLAG_REQUIRE_ACKED = 0x1000
View Source
const AOF_FLAG_REWRITED = 0x0001
View Source
const AOF_FLAG_TIMEOUTED = 0x0002
View Source
const AOF_FLAG_UPDATED = 0x0008
View Source
const AOF_LOCK_TYPE_ACK_ACKED = 4
View Source
const AOF_LOCK_TYPE_ACK_FILE = 3
View Source
const AOF_LOCK_TYPE_CONSISTENCY_BARRIER = 5
View Source
const AOF_LOCK_TYPE_FILE = 0
View Source
const AOF_LOCK_TYPE_LOAD = 1
View Source
const AOF_LOCK_TYPE_REPLAY = 2
View Source
const ARBITER_MEMBER_STATUS_CONNECTED = 3
View Source
const ARBITER_MEMBER_STATUS_OFFLINE = 4
View Source
const ARBITER_MEMBER_STATUS_ONLINE = 5
View Source
const ARBITER_MEMBER_STATUS_UNINIT = 2
View Source
const ARBITER_MEMBER_STATUS_UNOPEN = 1
View Source
const ARBITER_ROLE_ARBITER = 3
View Source
const ARBITER_ROLE_FOLLOWER = 2
View Source
const ARBITER_ROLE_LEADER = 1
View Source
const ARBITER_ROLE_UNKNOWN = 0
View Source
const EXPRIED_LOCKS_QUEUE_INIT_SIZE = 4096
View Source
const EXPRIED_QUEUE_LENGTH int64 = 0x10
View Source
const EXPRIED_QUEUE_LENGTH_MASK int64 = 0x0f
View Source
const EXPRIED_QUEUE_MAX_WAIT uint8 = 0x08
View Source
const EXPRIED_WAIT_LEADER_MAX_TIME int64 = 300
View Source
const FREE_COMMAND_MAX_SIZE = 256
View Source
const FREE_COMMAND_QUEUE_INIT_SIZE = 256
View Source
const FREE_LOCK_QUEUE_INIT_SIZE = 4096
View Source
const FREE_LONG_WAIT_QUEUE_INIT_SIZE = 8096
View Source
const FREE_MILLISECOND_WAIT_QUEUE_INIT_SIZE = 8096
View Source
const LONG_EXPRIED_LOCKS_INIT_COUNT = 256
View Source
const LONG_LOCKS_QUEUE_INIT_SIZE = 1024
View Source
const LONG_TIMEOUT_LOCKS_INIT_COUNT = 256
View Source
const MANAGER_MAX_GLOCKS_INIT_SIZE = 262144
View Source
const MILLISECOND_LOCKS_QUEUE_INIT_SIZE = 1024
View Source
const MILLISECOND_QUEUE_LENGTH = 3000
View Source
const QUEUE_MAX_MALLOC_SIZE = 0x3fffff
View Source
const REPLICATION_ACK_DB_INIT_SIZE = 256
View Source
const REPLICATION_MAX_FREE_ACK_LOCK_QUEUE_SIZE = 4096
View Source
const STREAMS_INIT_COUNT = 256
View Source
const TIMEOUT_LOCKS_QUEUE_INIT_SIZE = 4096
View Source
const TIMEOUT_QUEUE_LENGTH int64 = 0x10
View Source
const TIMEOUT_QUEUE_LENGTH_MASK int64 = 0x0f
View Source
const TIMEOUT_QUEUE_MAX_WAIT uint8 = 0x08
View Source
const VERSION = "2.1.0"
Variables ¶
View Source
var AGAIN = errors.New("AGAIN")
View Source
var ProposalRejectError = errors.New("Proposal Reject")
View Source
var ROLE_NAMES = []string{"unknown", "leader", "follower", "arbiter"}
View Source
var STATE_NAMES = []string{"initing", "leader", "follower", "syncing", "config", "vote", "close"}
Functions ¶
func FormatAofId ¶
func InitLogger ¶
func InitLogger(config *ServerConfig) (logging.Logger, error)
func ParseAofId ¶
func SetConfig ¶
func SetConfig(config *ServerConfig)
Types ¶
type Admin ¶
type Admin struct {
// contains filtered or unexported fields
}
func (*Admin) GetHandlers ¶
func (self *Admin) GetHandlers() map[string]TextServerProtocolCommandHandler
type Aof ¶
type Aof struct {
// contains filtered or unexported fields
}
func (*Aof) AppendLock ¶
func (*Aof) CloseAofChannel ¶
func (self *Aof) CloseAofChannel(aofChannel *AofChannel) *AofChannel
func (*Aof) ExecuteConsistencyBarrierCommand ¶
func (*Aof) FlushWithLocked ¶
func (self *Aof) FlushWithLocked()
func (*Aof) GetCurrentAofID ¶
func (*Aof) LoadAndInit ¶
func (*Aof) LoadAofFile ¶
func (*Aof) LoadAofFiles ¶
func (*Aof) LoadFileMaxAofLock ¶
func (*Aof) LoadMaxAofId ¶
func (*Aof) NewAofChannel ¶
func (self *Aof) NewAofChannel(lockDb *LockDB, lockDbGlockIndex uint16, lockDbGlock *PriorityMutex) *AofChannel
func (*Aof) RemoveAofChannel ¶
func (self *Aof) RemoveAofChannel(aofChannel *AofChannel) *AofChannel
func (*Aof) ReplayLock ¶
func (*Aof) RewriteAofFile ¶
func (*Aof) WaitFlushAofChannel ¶
func (*Aof) WaitRewriteAofFiles ¶
type AofChannel ¶
type AofChannel struct {
// contains filtered or unexported fields
}
func NewAofChannel ¶
func NewAofChannel(aof *Aof, lockDb *LockDB, lockDbGlockIndex uint16, lockDbGlock *PriorityMutex) *AofChannel
func (*AofChannel) Acked ¶
func (self *AofChannel) Acked(commandResult *protocol.LockResultCommand) error
func (*AofChannel) Handle ¶
func (self *AofChannel) Handle(aofLock *AofLock)
func (*AofChannel) HandleAcked ¶
func (self *AofChannel) HandleAcked(aofLock *AofLock)
func (*AofChannel) HandleAofAcked ¶
func (self *AofChannel) HandleAofAcked(aofLock *AofLock)
func (*AofChannel) HandleConsistencyBarrierCommand ¶
func (self *AofChannel) HandleConsistencyBarrierCommand(aofLock *AofLock)
func (*AofChannel) HandleLoad ¶
func (self *AofChannel) HandleLoad(aofLock *AofLock)
func (*AofChannel) HandleLock ¶
func (self *AofChannel) HandleLock(aofLock *AofLock)
func (*AofChannel) HandleReplay ¶
func (self *AofChannel) HandleReplay(aofLock *AofLock)
func (*AofChannel) Load ¶
func (self *AofChannel) Load(fromAofLock *AofLock) error
func (*AofChannel) Push ¶
func (self *AofChannel) Push(dbId uint8, lock *Lock, commandType uint8, lockCommand *protocol.LockCommand, unLockCommand *protocol.LockCommand, aofFlag uint16, lockData []byte) error
func (*AofChannel) Replay ¶
func (self *AofChannel) Replay(fromAofLock *AofLock) error
func (*AofChannel) Run ¶
func (self *AofChannel) Run()
type AofFile ¶
type AofFile struct {
// contains filtered or unexported fields
}
func (*AofFile) AppendLock ¶
func (*AofFile) ReadHeader ¶
func (*AofFile) ReadLockData ¶
func (*AofFile) WriteHeader ¶
func (*AofFile) WriteLockData ¶
type AofLock ¶
type AofLock struct { HandleType uint8 CommandType uint8 AofIndex uint32 AofOffset uint32 CommandTime uint64 Flag uint8 DbId uint8 LockId [16]byte LockKey [16]byte AofFlag uint16 StartTime uint16 ExpriedFlag uint16 ExpriedTime uint16 Count uint16 Rcount uint8 Result uint8 Lcount uint16 Lrcount uint8 // contains filtered or unexported fields }
func NewAofLock ¶
func NewAofLock() *AofLock
type AofLockQueue ¶
type AofLockQueue struct {
// contains filtered or unexported fields
}
type ArbiterClient ¶
type ArbiterClient struct {
// contains filtered or unexported fields
}
func NewArbiterClient ¶
func NewArbiterClient(member *ArbiterMember) *ArbiterClient
func (*ArbiterClient) Close ¶
func (self *ArbiterClient) Close() error
func (*ArbiterClient) Open ¶
func (self *ArbiterClient) Open(addr string) error
func (*ArbiterClient) Request ¶
func (self *ArbiterClient) Request(command *protocol.CallCommand) (*protocol.CallResultCommand, error)
func (*ArbiterClient) Run ¶
func (self *ArbiterClient) Run()
func (*ArbiterClient) WakeupRetryConnect ¶
func (self *ArbiterClient) WakeupRetryConnect() error
type ArbiterManager ¶
type ArbiterManager struct {
// contains filtered or unexported fields
}
func NewArbiterManager ¶
func NewArbiterManager(slock *SLock, name string) *ArbiterManager
func (*ArbiterManager) AddMember ¶
func (self *ArbiterManager) AddMember(host string, weight uint32, arbiter uint32) error
func (*ArbiterManager) Close ¶
func (self *ArbiterManager) Close() error
func (*ArbiterManager) CompareAofId ¶
func (self *ArbiterManager) CompareAofId(a [16]byte, b [16]byte) int
func (*ArbiterManager) Config ¶
func (self *ArbiterManager) Config(host string, weight uint32, arbiter uint32) error
func (*ArbiterManager) DecodeAofId ¶
func (self *ArbiterManager) DecodeAofId(aofIdString string) [16]byte
func (*ArbiterManager) DoAnnouncement ¶
func (self *ArbiterManager) DoAnnouncement()
func (*ArbiterManager) EncodeAofId ¶
func (self *ArbiterManager) EncodeAofId(aofId [16]byte) string
func (*ArbiterManager) GetCallMethods ¶
func (self *ArbiterManager) GetCallMethods() map[string]BinaryServerProtocolCallHandler
func (*ArbiterManager) GetCurrentAofID ¶
func (self *ArbiterManager) GetCurrentAofID() [16]byte
func (*ArbiterManager) GetMajorityMemberCount ¶
func (self *ArbiterManager) GetMajorityMemberCount() int
func (*ArbiterManager) GetMembers ¶
func (self *ArbiterManager) GetMembers() []*ArbiterMember
func (*ArbiterManager) Load ¶
func (self *ArbiterManager) Load() error
func (*ArbiterManager) QuitLeader ¶
func (self *ArbiterManager) QuitLeader() error
func (*ArbiterManager) QuitMember ¶
func (self *ArbiterManager) QuitMember() error
func (*ArbiterManager) RemoveMember ¶
func (self *ArbiterManager) RemoveMember(host string) error
func (*ArbiterManager) Start ¶
func (self *ArbiterManager) Start() error
func (*ArbiterManager) StartVote ¶
func (self *ArbiterManager) StartVote() error
func (*ArbiterManager) UpdateMember ¶
func (self *ArbiterManager) UpdateMember(host string, weight uint32, arbiter uint32) error
type ArbiterMember ¶
type ArbiterMember struct {
// contains filtered or unexported fields
}
func NewArbiterMember ¶
func NewArbiterMember(manager *ArbiterManager, host string, weight uint32, arbiter uint32) *ArbiterMember
func (*ArbiterMember) Close ¶
func (self *ArbiterMember) Close() error
func (*ArbiterMember) DoAnnouncement ¶
func (self *ArbiterMember) DoAnnouncement() (*protobuf.ArbiterAnnouncementResponse, error)
func (*ArbiterMember) DoCommit ¶
func (self *ArbiterMember) DoCommit(proposalId uint64, host string, aofId [16]byte) (*protobuf.ArbiterCommitResponse, error)
func (*ArbiterMember) DoProposal ¶
func (self *ArbiterMember) DoProposal(proposalId uint64, host string, aofId [16]byte) (*protobuf.ArbiterProposalResponse, error)
func (*ArbiterMember) DoVote ¶
func (self *ArbiterMember) DoVote() (*protobuf.ArbiterVoteResponse, error)
func (*ArbiterMember) Open ¶
func (self *ArbiterMember) Open() error
func (*ArbiterMember) Run ¶
func (self *ArbiterMember) Run()
func (*ArbiterMember) UpdateStatus ¶
func (self *ArbiterMember) UpdateStatus() error
func (*ArbiterMember) Wakeup ¶
func (self *ArbiterMember) Wakeup()
type ArbiterServer ¶
type ArbiterServer struct {
// contains filtered or unexported fields
}
func NewArbiterServer ¶
func NewArbiterServer(protocol *BinaryServerProtocol) *ArbiterServer
func (*ArbiterServer) Attach ¶
func (self *ArbiterServer) Attach(manager *ArbiterManager, fromHost string) error
func (*ArbiterServer) Close ¶
func (self *ArbiterServer) Close() error
func (*ArbiterServer) Run ¶
func (self *ArbiterServer) Run()
type ArbiterStore ¶
type ArbiterStore struct {
// contains filtered or unexported fields
}
func NewArbiterStore ¶
func NewArbiterStore() *ArbiterStore
func (*ArbiterStore) Init ¶
func (self *ArbiterStore) Init(manager *ArbiterManager) error
func (*ArbiterStore) Load ¶
func (self *ArbiterStore) Load(manager *ArbiterManager) error
func (*ArbiterStore) Save ¶
func (self *ArbiterStore) Save(manager *ArbiterManager) error
type ArbiterVoter ¶
type ArbiterVoter struct {
// contains filtered or unexported fields
}
func NewArbiterVoter ¶
func NewArbiterVoter() *ArbiterVoter
func (*ArbiterVoter) Close ¶
func (self *ArbiterVoter) Close() error
func (*ArbiterVoter) DoAnnouncement ¶
func (self *ArbiterVoter) DoAnnouncement() error
func (*ArbiterVoter) DoCommit ¶
func (self *ArbiterVoter) DoCommit() error
func (*ArbiterVoter) DoProposal ¶
func (self *ArbiterVoter) DoProposal() error
func (*ArbiterVoter) DoRequests ¶
func (self *ArbiterVoter) DoRequests(name string, handler func(*ArbiterMember) (interface{}, error)) []interface{}
func (*ArbiterVoter) DoVote ¶
func (self *ArbiterVoter) DoVote() error
func (*ArbiterVoter) StartVote ¶
func (self *ArbiterVoter) StartVote() error
func (*ArbiterVoter) WakeupRetryVote ¶
func (self *ArbiterVoter) WakeupRetryVote() error
type ArbiterVoterSubscriber ¶
type ArbiterVoterSubscriber struct {
// contains filtered or unexported fields
}
type BinaryServerProtocol ¶
type BinaryServerProtocol struct {
// contains filtered or unexported fields
}
func NewBinaryServerProtocol ¶
func NewBinaryServerProtocol(slock *SLock, stream *Stream) *BinaryServerProtocol
func (*BinaryServerProtocol) AddProxy ¶
func (self *BinaryServerProtocol) AddProxy(proxy *ProxyServerProtocol) error
func (*BinaryServerProtocol) Close ¶
func (self *BinaryServerProtocol) Close() error
func (*BinaryServerProtocol) FindCallMethod ¶
func (self *BinaryServerProtocol) FindCallMethod(methodName string) (BinaryServerProtocolCallHandler, error)
func (*BinaryServerProtocol) FreeLockCommand ¶
func (self *BinaryServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
func (*BinaryServerProtocol) FreeLockCommandLocked ¶
func (self *BinaryServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
func (*BinaryServerProtocol) GetLockCommand ¶
func (self *BinaryServerProtocol) GetLockCommand() *protocol.LockCommand
func (*BinaryServerProtocol) GetLockCommandLocked ¶
func (self *BinaryServerProtocol) GetLockCommandLocked() *protocol.LockCommand
func (*BinaryServerProtocol) GetProxy ¶
func (self *BinaryServerProtocol) GetProxy() *ProxyServerProtocol
func (*BinaryServerProtocol) GetStream ¶
func (self *BinaryServerProtocol) GetStream() *Stream
func (*BinaryServerProtocol) Init ¶
func (self *BinaryServerProtocol) Init(clientId [16]byte) error
func (*BinaryServerProtocol) InitLockCommand ¶
func (self *BinaryServerProtocol) InitLockCommand()
func (*BinaryServerProtocol) Lock ¶
func (self *BinaryServerProtocol) Lock()
func (*BinaryServerProtocol) Process ¶
func (self *BinaryServerProtocol) Process() error
func (*BinaryServerProtocol) ProcessBuild ¶
func (self *BinaryServerProtocol) ProcessBuild(command protocol.ICommand) error
func (*BinaryServerProtocol) ProcessCommad ¶
func (self *BinaryServerProtocol) ProcessCommad(command protocol.ICommand) error
func (*BinaryServerProtocol) ProcessLockCommand ¶
func (self *BinaryServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
func (*BinaryServerProtocol) ProcessLockResultCommand ¶
func (self *BinaryServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*BinaryServerProtocol) ProcessLockResultCommandLocked ¶
func (self *BinaryServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*BinaryServerProtocol) ProcessParse ¶
func (self *BinaryServerProtocol) ProcessParse(buf []byte) error
func (*BinaryServerProtocol) ProcessParseLockData ¶
func (self *BinaryServerProtocol) ProcessParseLockData() (*protocol.LockCommandData, error)
func (*BinaryServerProtocol) Read ¶
func (self *BinaryServerProtocol) Read() (protocol.CommandDecode, error)
func (*BinaryServerProtocol) ReadCommand ¶
func (self *BinaryServerProtocol) ReadCommand() (protocol.CommandDecode, error)
func (*BinaryServerProtocol) ReadParse ¶
func (self *BinaryServerProtocol) ReadParse(buf []byte) (protocol.CommandDecode, error)
func (*BinaryServerProtocol) RemoteAddr ¶
func (self *BinaryServerProtocol) RemoteAddr() net.Addr
func (*BinaryServerProtocol) UnInitLockCommand ¶
func (self *BinaryServerProtocol) UnInitLockCommand()
func (*BinaryServerProtocol) Unlock ¶
func (self *BinaryServerProtocol) Unlock()
func (*BinaryServerProtocol) Write ¶
func (self *BinaryServerProtocol) Write(result protocol.CommandEncode) error
func (*BinaryServerProtocol) WriteCommand ¶
func (self *BinaryServerProtocol) WriteCommand(result protocol.CommandEncode) error
type BinaryServerProtocolCallHandler ¶
type BinaryServerProtocolCallHandler func(*BinaryServerProtocol, *protocol.CallCommand) (*protocol.CallResultCommand, error)
type DefaultServerProtocol ¶
type DefaultServerProtocol struct {
// contains filtered or unexported fields
}
func NewDefaultServerProtocol ¶
func NewDefaultServerProtocol(slock *SLock) *DefaultServerProtocol
func (*DefaultServerProtocol) AddProxy ¶
func (self *DefaultServerProtocol) AddProxy(_ *ProxyServerProtocol) error
func (*DefaultServerProtocol) Close ¶
func (self *DefaultServerProtocol) Close() error
func (*DefaultServerProtocol) FreeLockCommand ¶
func (self *DefaultServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
func (*DefaultServerProtocol) FreeLockCommandLocked ¶
func (self *DefaultServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
func (*DefaultServerProtocol) GetLockCommand ¶
func (self *DefaultServerProtocol) GetLockCommand() *protocol.LockCommand
func (*DefaultServerProtocol) GetLockCommandLocked ¶
func (self *DefaultServerProtocol) GetLockCommandLocked() *protocol.LockCommand
func (*DefaultServerProtocol) GetProxy ¶
func (self *DefaultServerProtocol) GetProxy() *ProxyServerProtocol
func (*DefaultServerProtocol) GetStream ¶
func (self *DefaultServerProtocol) GetStream() *Stream
func (*DefaultServerProtocol) Init ¶
func (self *DefaultServerProtocol) Init(_ [16]byte) error
func (*DefaultServerProtocol) Lock ¶
func (self *DefaultServerProtocol) Lock()
func (*DefaultServerProtocol) Process ¶
func (self *DefaultServerProtocol) Process() error
func (*DefaultServerProtocol) ProcessBuild ¶
func (self *DefaultServerProtocol) ProcessBuild(_ protocol.ICommand) error
func (*DefaultServerProtocol) ProcessCommad ¶
func (self *DefaultServerProtocol) ProcessCommad(command protocol.ICommand) error
func (*DefaultServerProtocol) ProcessLockCommand ¶
func (self *DefaultServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
func (*DefaultServerProtocol) ProcessLockResultCommand ¶
func (self *DefaultServerProtocol) ProcessLockResultCommand(_ *protocol.LockCommand, _ uint8, _ uint16, _ uint8, _ []byte) error
func (*DefaultServerProtocol) ProcessLockResultCommandLocked ¶
func (self *DefaultServerProtocol) ProcessLockResultCommandLocked(_ *protocol.LockCommand, _ uint8, _ uint16, _ uint8, _ []byte) error
func (*DefaultServerProtocol) ProcessParse ¶
func (self *DefaultServerProtocol) ProcessParse(_ []byte) error
func (*DefaultServerProtocol) Read ¶
func (self *DefaultServerProtocol) Read() (protocol.CommandDecode, error)
func (*DefaultServerProtocol) ReadCommand ¶
func (self *DefaultServerProtocol) ReadCommand() (protocol.CommandDecode, error)
func (*DefaultServerProtocol) RemoteAddr ¶
func (self *DefaultServerProtocol) RemoteAddr() net.Addr
func (*DefaultServerProtocol) Unlock ¶
func (self *DefaultServerProtocol) Unlock()
func (*DefaultServerProtocol) Write ¶
func (self *DefaultServerProtocol) Write(protocol.CommandEncode) error
func (*DefaultServerProtocol) WriteCommand ¶
func (self *DefaultServerProtocol) WriteCommand(protocol.CommandEncode) error
type FastKeyValue ¶
type FastKeyValue struct {
// contains filtered or unexported fields
}
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
func NewLock ¶
func NewLock(manager *LockManager, protocol ServerProtocol, command *protocol.LockCommand) *Lock
func (*Lock) AddLockCommandData ¶
func (self *Lock) AddLockCommandData(lockCommandData *protocol.LockCommandData)
func (*Lock) SaveRecoverData ¶
func (self *Lock) SaveRecoverData(recoverData *LockManagerData, recoverValue interface{})
type LockCommandQueue ¶
type LockCommandQueue struct {
// contains filtered or unexported fields
}
func NewLockCommandQueue ¶
func NewLockCommandQueue(baseNodeSize int32, nodeSize int32, queueSize int32) *LockCommandQueue
func (*LockCommandQueue) Head ¶
func (self *LockCommandQueue) Head() *protocol.LockCommand
func (*LockCommandQueue) IterNodeQueues ¶
func (self *LockCommandQueue) IterNodeQueues(index int32) []*protocol.LockCommand
func (*LockCommandQueue) IterNodes ¶
func (self *LockCommandQueue) IterNodes() [][]*protocol.LockCommand
func (*LockCommandQueue) Len ¶
func (self *LockCommandQueue) Len() int32
func (*LockCommandQueue) Pop ¶
func (self *LockCommandQueue) Pop() *protocol.LockCommand
func (*LockCommandQueue) PopRight ¶
func (self *LockCommandQueue) PopRight() *protocol.LockCommand
func (*LockCommandQueue) Push ¶
func (self *LockCommandQueue) Push(lock *protocol.LockCommand) error
func (*LockCommandQueue) PushLeft ¶
func (self *LockCommandQueue) PushLeft(lock *protocol.LockCommand) error
func (*LockCommandQueue) Rellac ¶
func (self *LockCommandQueue) Rellac() error
func (*LockCommandQueue) Reset ¶
func (self *LockCommandQueue) Reset() error
func (*LockCommandQueue) Resize ¶
func (self *LockCommandQueue) Resize() error
func (*LockCommandQueue) Restructuring ¶
func (self *LockCommandQueue) Restructuring() error
func (*LockCommandQueue) Shrink ¶
func (self *LockCommandQueue) Shrink(size int32) int32
func (*LockCommandQueue) Tail ¶
func (self *LockCommandQueue) Tail() *protocol.LockCommand
type LockDB ¶
type LockDB struct {
// contains filtered or unexported fields
}
func (*LockDB) AddExpried ¶
func (*LockDB) AddMillisecondExpried ¶
func (*LockDB) AddMillisecondTimeOut ¶
func (*LockDB) AddTimeOut ¶
func (*LockDB) CheckProbableLock ¶
func (self *LockDB) CheckProbableLock(serverProtocol ServerProtocol, command *protocol.LockCommand) bool
func (*LockDB) GetLockManager ¶
func (self *LockDB) GetLockManager(command *protocol.LockCommand) *LockManager
func (*LockDB) GetOrNewLockManager ¶
func (self *LockDB) GetOrNewLockManager(command *protocol.LockCommand) *LockManager
func (*LockDB) GetState ¶
func (self *LockDB) GetState() *protocol.LockDBState
func (*LockDB) HasLock ¶
func (self *LockDB) HasLock(command *protocol.LockCommand, aofLockData []byte) bool
func (*LockDB) Lock ¶
func (self *LockDB) Lock(serverProtocol ServerProtocol, command *protocol.LockCommand, lockPriorityLevel uint8) error
func (*LockDB) PushExecutorLockCommand ¶
func (self *LockDB) PushExecutorLockCommand(lockManager *LockManager, serverProtocol ServerProtocol, lockCommand *protocol.LockCommand) error
func (*LockDB) RemoveExpried ¶
func (*LockDB) RemoveLockManager ¶
func (self *LockDB) RemoveLockManager(lockManager *LockManager)
func (*LockDB) RemoveLongExpried ¶
func (*LockDB) RemoveLongTimeOut ¶
func (*LockDB) RemoveTimeOut ¶
func (*LockDB) UnLock ¶
func (self *LockDB) UnLock(serverProtocol ServerProtocol, command *protocol.LockCommand, lockPriorityLevel uint8) error
type LockDBExecutor ¶
type LockDBExecutor struct {
// contains filtered or unexported fields
}
func (*LockDBExecutor) Push ¶
func (self *LockDBExecutor) Push(serverProtocol ServerProtocol, lockCommand *protocol.LockCommand)
func (*LockDBExecutor) Run ¶
func (self *LockDBExecutor) Run()
type LockDBExecutorTask ¶
type LockDBExecutorTask struct {
// contains filtered or unexported fields
}
type LockData ¶
type LockData struct {
// contains filtered or unexported fields
}
func (*LockData) ProcessAckClear ¶
type LockManager ¶
type LockManager struct {
// contains filtered or unexported fields
}
func NewLockManager ¶
func NewLockManager(lockDb *LockDB, command *protocol.LockCommand, glock *PriorityMutex, glockIndex uint16, freeLocks *LockQueue, state *protocol.LockDBState) *LockManager
func (*LockManager) AddLock ¶
func (self *LockManager) AddLock(lock *Lock) *Lock
func (*LockManager) AddWaitLock ¶
func (self *LockManager) AddWaitLock(lock *Lock) *Lock
func (*LockManager) AofLockData ¶
func (self *LockManager) AofLockData(commandType uint8, lock *Lock) []byte
func (*LockManager) FreeLock ¶
func (self *LockManager) FreeLock(lock *Lock) *Lock
func (*LockManager) GetDB ¶
func (self *LockManager) GetDB() *LockDB
func (*LockManager) GetLockData ¶
func (self *LockManager) GetLockData() []byte
func (*LockManager) GetLockedLock ¶
func (self *LockManager) GetLockedLock(command *protocol.LockCommand) *Lock
func (*LockManager) GetOrNewLock ¶
func (self *LockManager) GetOrNewLock(serverProtocol ServerProtocol, command *protocol.LockCommand) *Lock
func (*LockManager) GetWaitLock ¶
func (self *LockManager) GetWaitLock() *Lock
func (*LockManager) ProcessAckLockData ¶
func (self *LockManager) ProcessAckLockData(lock *Lock) []byte
func (*LockManager) ProcessExecuteLockCommand ¶
func (self *LockManager) ProcessExecuteLockCommand(lock *Lock, commandStage uint8)
func (*LockManager) ProcessLockData ¶
func (self *LockManager) ProcessLockData(command *protocol.LockCommand, lock *Lock, requireRecover bool)
func (*LockManager) ProcessRecoverLockData ¶
func (self *LockManager) ProcessRecoverLockData(lock *Lock)
func (*LockManager) PushLockAof ¶
func (self *LockManager) PushLockAof(lock *Lock, aofFlag uint16) error
func (*LockManager) PushUnLockAof ¶
func (self *LockManager) PushUnLockAof(dbId uint8, lock *Lock, lockCommand *protocol.LockCommand, unLockCommand *protocol.LockCommand, isAof bool, aofFlag uint16) error
func (*LockManager) RemoveLock ¶
func (self *LockManager) RemoveLock(lock *Lock) *Lock
func (*LockManager) UpdateLockedLock ¶
type LockManagerData ¶
type LockManagerData struct {
// contains filtered or unexported fields
}
func NewLockManagerData ¶
func NewLockManagerData(data []byte, commandType uint8) *LockManagerData
func NewLockManagerDataUnsetData ¶
func NewLockManagerDataUnsetData() *LockManagerData
func (*LockManagerData) Equal ¶
func (self *LockManagerData) Equal(lockData []byte) bool
func (*LockManagerData) GetData ¶
func (self *LockManagerData) GetData() []byte
func (*LockManagerData) GetIncrValue ¶
func (self *LockManagerData) GetIncrValue() int64
type LockQueue ¶
type LockQueue struct {
// contains filtered or unexported fields
}
func NewLockQueue ¶
func (*LockQueue) IterNodeQueues ¶
func (*LockQueue) Restructuring ¶
type LongWaitLockFreeQueue ¶
type LongWaitLockFreeQueue struct {
// contains filtered or unexported fields
}
type LongWaitLockQueue ¶
type LongWaitLockQueue struct {
// contains filtered or unexported fields
}
type MemWaiterServerProtocol ¶
type MemWaiterServerProtocol struct {
// contains filtered or unexported fields
}
func NewMemWaiterServerProtocol ¶
func NewMemWaiterServerProtocol(slock *SLock) *MemWaiterServerProtocol
func (*MemWaiterServerProtocol) AddProxy ¶
func (self *MemWaiterServerProtocol) AddProxy(proxy *ProxyServerProtocol) error
func (*MemWaiterServerProtocol) AddWaiter ¶
func (self *MemWaiterServerProtocol) AddWaiter(command *protocol.LockCommand, waiter chan *protocol.LockResultCommand) error
func (*MemWaiterServerProtocol) Close ¶
func (self *MemWaiterServerProtocol) Close() error
func (*MemWaiterServerProtocol) FreeLockCommand ¶
func (self *MemWaiterServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
func (*MemWaiterServerProtocol) FreeLockCommandLocked ¶
func (self *MemWaiterServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
func (*MemWaiterServerProtocol) GetLockCommand ¶
func (self *MemWaiterServerProtocol) GetLockCommand() *protocol.LockCommand
func (*MemWaiterServerProtocol) GetLockCommandLocked ¶
func (self *MemWaiterServerProtocol) GetLockCommandLocked() *protocol.LockCommand
func (*MemWaiterServerProtocol) GetProxy ¶
func (self *MemWaiterServerProtocol) GetProxy() *ProxyServerProtocol
func (*MemWaiterServerProtocol) GetStream ¶
func (self *MemWaiterServerProtocol) GetStream() *Stream
func (*MemWaiterServerProtocol) Init ¶
func (self *MemWaiterServerProtocol) Init(_ [16]byte) error
func (*MemWaiterServerProtocol) InitLockCommand ¶
func (self *MemWaiterServerProtocol) InitLockCommand()
func (*MemWaiterServerProtocol) Lock ¶
func (self *MemWaiterServerProtocol) Lock()
func (*MemWaiterServerProtocol) Process ¶
func (self *MemWaiterServerProtocol) Process() error
func (*MemWaiterServerProtocol) ProcessBuild ¶
func (self *MemWaiterServerProtocol) ProcessBuild(_ protocol.ICommand) error
func (*MemWaiterServerProtocol) ProcessCommad ¶
func (self *MemWaiterServerProtocol) ProcessCommad(_ protocol.ICommand) error
func (*MemWaiterServerProtocol) ProcessLockCommand ¶
func (self *MemWaiterServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
func (*MemWaiterServerProtocol) ProcessLockResultCommand ¶
func (self *MemWaiterServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*MemWaiterServerProtocol) ProcessLockResultCommandLocked ¶
func (self *MemWaiterServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*MemWaiterServerProtocol) ProcessParse ¶
func (self *MemWaiterServerProtocol) ProcessParse(_ []byte) error
func (*MemWaiterServerProtocol) Read ¶
func (self *MemWaiterServerProtocol) Read() (protocol.CommandDecode, error)
func (*MemWaiterServerProtocol) ReadCommand ¶
func (self *MemWaiterServerProtocol) ReadCommand() (protocol.CommandDecode, error)
func (*MemWaiterServerProtocol) RemoteAddr ¶
func (self *MemWaiterServerProtocol) RemoteAddr() net.Addr
func (*MemWaiterServerProtocol) RemoveWaiter ¶
func (self *MemWaiterServerProtocol) RemoveWaiter(command *protocol.LockCommand) error
func (*MemWaiterServerProtocol) SetResultCallback ¶
func (self *MemWaiterServerProtocol) SetResultCallback(callback MemWaiterServerProtocolResultCallback) error
func (*MemWaiterServerProtocol) UnInitLockCommand ¶
func (self *MemWaiterServerProtocol) UnInitLockCommand()
func (*MemWaiterServerProtocol) Unlock ¶
func (self *MemWaiterServerProtocol) Unlock()
func (*MemWaiterServerProtocol) Write ¶
func (self *MemWaiterServerProtocol) Write(protocol.CommandEncode) error
func (*MemWaiterServerProtocol) WriteCommand ¶
func (self *MemWaiterServerProtocol) WriteCommand(protocol.CommandEncode) error
type MemWaiterServerProtocolResultCallback ¶
type MemWaiterServerProtocolResultCallback func(*MemWaiterServerProtocol, *protocol.LockCommand, uint8, uint16, uint8, []byte) error
type MillisecondWaitLockFreeQueue ¶
type MillisecondWaitLockFreeQueue struct {
// contains filtered or unexported fields
}
type PriorityMutex ¶
type PriorityMutex struct {
// contains filtered or unexported fields
}
func NewPriorityMutex ¶
func NewPriorityMutex() *PriorityMutex
func (*PriorityMutex) HighPriorityLock ¶
func (self *PriorityMutex) HighPriorityLock()
func (*PriorityMutex) HighPriorityMutexWait ¶
func (self *PriorityMutex) HighPriorityMutexWait()
func (*PriorityMutex) HighPriorityUnlock ¶
func (self *PriorityMutex) HighPriorityUnlock()
func (*PriorityMutex) HighSetPriority ¶
func (self *PriorityMutex) HighSetPriority() bool
func (*PriorityMutex) HighUnSetPriority ¶
func (self *PriorityMutex) HighUnSetPriority() bool
func (*PriorityMutex) Lock ¶
func (self *PriorityMutex) Lock()
func (*PriorityMutex) LowPriorityLock ¶
func (self *PriorityMutex) LowPriorityLock()
func (*PriorityMutex) LowPriorityUnlock ¶
func (self *PriorityMutex) LowPriorityUnlock()
func (*PriorityMutex) LowSetPriority ¶
func (self *PriorityMutex) LowSetPriority() bool
func (*PriorityMutex) LowUnSetPriority ¶
func (self *PriorityMutex) LowUnSetPriority() bool
func (*PriorityMutex) Unlock ¶
func (self *PriorityMutex) Unlock()
type ProxyServerProtocol ¶
type ProxyServerProtocol struct {
// contains filtered or unexported fields
}
func (*ProxyServerProtocol) AddProxy ¶
func (self *ProxyServerProtocol) AddProxy(proxyServerProtocol *ProxyServerProtocol) error
func (*ProxyServerProtocol) Close ¶
func (self *ProxyServerProtocol) Close() error
func (*ProxyServerProtocol) FreeLockCommand ¶
func (self *ProxyServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
func (*ProxyServerProtocol) FreeLockCommandLocked ¶
func (self *ProxyServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
func (*ProxyServerProtocol) GetLockCommand ¶
func (self *ProxyServerProtocol) GetLockCommand() *protocol.LockCommand
func (*ProxyServerProtocol) GetLockCommandLocked ¶
func (self *ProxyServerProtocol) GetLockCommandLocked() *protocol.LockCommand
func (*ProxyServerProtocol) GetProxy ¶
func (self *ProxyServerProtocol) GetProxy() *ProxyServerProtocol
func (*ProxyServerProtocol) GetStream ¶
func (self *ProxyServerProtocol) GetStream() *Stream
func (*ProxyServerProtocol) Init ¶
func (self *ProxyServerProtocol) Init(clientId [16]byte) error
func (*ProxyServerProtocol) Lock ¶
func (self *ProxyServerProtocol) Lock()
func (*ProxyServerProtocol) Process ¶
func (self *ProxyServerProtocol) Process() error
func (*ProxyServerProtocol) ProcessBuild ¶
func (self *ProxyServerProtocol) ProcessBuild(command protocol.ICommand) error
func (*ProxyServerProtocol) ProcessCommad ¶
func (self *ProxyServerProtocol) ProcessCommad(command protocol.ICommand) error
func (*ProxyServerProtocol) ProcessLockCommand ¶
func (self *ProxyServerProtocol) ProcessLockCommand(command *protocol.LockCommand) error
func (*ProxyServerProtocol) ProcessLockResultCommand ¶
func (self *ProxyServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*ProxyServerProtocol) ProcessLockResultCommandLocked ¶
func (self *ProxyServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*ProxyServerProtocol) ProcessParse ¶
func (self *ProxyServerProtocol) ProcessParse(buf []byte) error
func (*ProxyServerProtocol) Read ¶
func (self *ProxyServerProtocol) Read() (protocol.CommandDecode, error)
func (*ProxyServerProtocol) ReadCommand ¶
func (self *ProxyServerProtocol) ReadCommand() (protocol.CommandDecode, error)
func (*ProxyServerProtocol) RemoteAddr ¶
func (self *ProxyServerProtocol) RemoteAddr() net.Addr
func (*ProxyServerProtocol) Unlock ¶
func (self *ProxyServerProtocol) Unlock()
func (*ProxyServerProtocol) Write ¶
func (self *ProxyServerProtocol) Write(command protocol.CommandEncode) error
func (*ProxyServerProtocol) WriteCommand ¶
func (self *ProxyServerProtocol) WriteCommand(command protocol.CommandEncode) error
type PublishLock ¶
type PublishLock struct { Magic uint8 Version uint8 CommandType uint8 RequestId [16]byte Result uint8 Flag uint8 DbId uint8 LockId [16]byte LockKey [16]byte Lcount uint16 Count uint16 Lrcount uint8 Rcount uint8 // contains filtered or unexported fields }
func NewPublishLock ¶
func NewPublishLock() *PublishLock
func (*PublishLock) Decode ¶
func (self *PublishLock) Decode() error
func (*PublishLock) Encode ¶
func (self *PublishLock) Encode() error
func (*PublishLock) GetCommandType ¶
func (self *PublishLock) GetCommandType() uint8
type ReplicationAckDB ¶
type ReplicationAckDB struct {
// contains filtered or unexported fields
}
func NewReplicationAckDB ¶
func NewReplicationAckDB(manager *ReplicationManager) *ReplicationAckDB
func (*ReplicationAckDB) Close ¶
func (self *ReplicationAckDB) Close() error
func (*ReplicationAckDB) FlushDB ¶
func (self *ReplicationAckDB) FlushDB() error
func (*ReplicationAckDB) ProcessFollowerAckAofed ¶
func (self *ReplicationAckDB) ProcessFollowerAckAofed(glockIndex uint16, aofLock *AofLock) error
func (*ReplicationAckDB) ProcessFollowerAckLocked ¶
func (self *ReplicationAckDB) ProcessFollowerAckLocked(glockIndex uint16, command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8) error
func (*ReplicationAckDB) ProcessFollowerPushAckLock ¶
func (self *ReplicationAckDB) ProcessFollowerPushAckLock(glockIndex uint16, aofLock *AofLock) error
func (*ReplicationAckDB) ProcessFollowerPushAckUnLock ¶
func (self *ReplicationAckDB) ProcessFollowerPushAckUnLock(glockIndex uint16, aofLock *AofLock) error
func (*ReplicationAckDB) ProcessLeaderAcked ¶
func (self *ReplicationAckDB) ProcessLeaderAcked(glockIndex uint16, aofLock *AofLock) error
func (*ReplicationAckDB) ProcessLeaderAofed ¶
func (self *ReplicationAckDB) ProcessLeaderAofed(glockIndex uint16, aofLock *AofLock) error
func (*ReplicationAckDB) ProcessLeaderPushLock ¶
func (self *ReplicationAckDB) ProcessLeaderPushLock(glockIndex uint16, aofLock *AofLock) error
func (*ReplicationAckDB) ProcessLeaderPushUnLock ¶
func (self *ReplicationAckDB) ProcessLeaderPushUnLock(glockIndex uint16, aofLock *AofLock) error
func (*ReplicationAckDB) SwitchToFollower ¶
func (self *ReplicationAckDB) SwitchToFollower() error
func (*ReplicationAckDB) SwitchToLeader ¶
func (self *ReplicationAckDB) SwitchToLeader() error
type ReplicationAckLock ¶
type ReplicationAckLock struct {
// contains filtered or unexported fields
}
func NewReplicationAckLock ¶
func NewReplicationAckLock() *ReplicationAckLock
type ReplicationBufferQueue ¶
type ReplicationBufferQueue struct {
// contains filtered or unexported fields
}
func NewReplicationBufferQueue ¶
func NewReplicationBufferQueue(manager *ReplicationManager, bufSize uint64, maxSize uint64) *ReplicationBufferQueue
func (*ReplicationBufferQueue) AddPoll ¶
func (self *ReplicationBufferQueue) AddPoll(cursor *ReplicationBufferQueueCursor)
func (*ReplicationBufferQueue) Close ¶
func (self *ReplicationBufferQueue) Close() error
func (*ReplicationBufferQueue) Head ¶
func (self *ReplicationBufferQueue) Head(cursor *ReplicationBufferQueueCursor) error
func (*ReplicationBufferQueue) InitFreeQueueItems ¶
func (self *ReplicationBufferQueue) InitFreeQueueItems(count uint64)
func (*ReplicationBufferQueue) Pop ¶
func (self *ReplicationBufferQueue) Pop(cursor *ReplicationBufferQueueCursor) error
func (*ReplicationBufferQueue) Push ¶
func (self *ReplicationBufferQueue) Push(buf []byte, data []byte) error
func (*ReplicationBufferQueue) RemovePoll ¶
func (self *ReplicationBufferQueue) RemovePoll(cursor *ReplicationBufferQueueCursor)
func (*ReplicationBufferQueue) Search ¶
func (self *ReplicationBufferQueue) Search(aofId [16]byte, cursor *ReplicationBufferQueueCursor) error
type ReplicationBufferQueueCursor ¶
type ReplicationBufferQueueCursor struct {
// contains filtered or unexported fields
}
func NewReplicationBufferQueueCursor ¶
func NewReplicationBufferQueueCursor(buf []byte) *ReplicationBufferQueueCursor
type ReplicationBufferQueueItem ¶
type ReplicationBufferQueueItem struct {
// contains filtered or unexported fields
}
func NewReplicationBufferQueueItem ¶
func NewReplicationBufferQueueItem() *ReplicationBufferQueueItem
func (*ReplicationBufferQueueItem) Init ¶
func (self *ReplicationBufferQueueItem) Init(buf []byte)
type ReplicationClient ¶
type ReplicationClient struct {
// contains filtered or unexported fields
}
func NewReplicationClient ¶
func NewReplicationClient(manager *ReplicationManager) *ReplicationClient
func (*ReplicationClient) Close ¶
func (self *ReplicationClient) Close() error
func (*ReplicationClient) HandleAcked ¶
func (self *ReplicationClient) HandleAcked(ackLock *ReplicationAckLock) error
func (*ReplicationClient) InitSync ¶
func (self *ReplicationClient) InitSync() error
func (*ReplicationClient) Open ¶
func (self *ReplicationClient) Open(addr string) error
func (*ReplicationClient) Process ¶
func (self *ReplicationClient) Process() error
func (*ReplicationClient) ProcessAofAppend ¶
func (self *ReplicationClient) ProcessAofAppend()
func (*ReplicationClient) ProcessPushAofLock ¶
func (self *ReplicationClient) ProcessPushAofLock()
func (*ReplicationClient) ProcessReplayLock ¶
func (self *ReplicationClient) ProcessReplayLock()
func (*ReplicationClient) Run ¶
func (self *ReplicationClient) Run()
func (*ReplicationClient) WakeupRetryConnect ¶
func (self *ReplicationClient) WakeupRetryConnect() error
type ReplicationClientState ¶
type ReplicationClientState struct {
// contains filtered or unexported fields
}
type ReplicationManager ¶
type ReplicationManager struct {
// contains filtered or unexported fields
}
func NewReplicationManager ¶
func NewReplicationManager() *ReplicationManager
func (*ReplicationManager) ChangeLeader ¶
func (self *ReplicationManager) ChangeLeader(address string) error
func (*ReplicationManager) Close ¶
func (self *ReplicationManager) Close()
func (*ReplicationManager) FlushDB ¶
func (self *ReplicationManager) FlushDB() error
func (*ReplicationManager) GetAckDB ¶
func (self *ReplicationManager) GetAckDB(dbId uint8) *ReplicationAckDB
func (*ReplicationManager) GetCallMethods ¶
func (self *ReplicationManager) GetCallMethods() map[string]BinaryServerProtocolCallHandler
func (*ReplicationManager) GetCurrentAofID ¶
func (self *ReplicationManager) GetCurrentAofID() [16]byte
func (*ReplicationManager) GetHandlers ¶
func (self *ReplicationManager) GetHandlers() map[string]TextServerProtocolCommandHandler
func (*ReplicationManager) GetOrNewAckDB ¶
func (self *ReplicationManager) GetOrNewAckDB(dbId uint8) *ReplicationAckDB
func (*ReplicationManager) Init ¶
func (self *ReplicationManager) Init(leaderAddress string, aofId [16]byte) error
func (*ReplicationManager) PushLock ¶
func (self *ReplicationManager) PushLock(glockIndex uint16, aofLock *AofLock) error
func (*ReplicationManager) StartSync ¶
func (self *ReplicationManager) StartSync() error
func (*ReplicationManager) SwitchToFollower ¶
func (self *ReplicationManager) SwitchToFollower(address string) error
func (*ReplicationManager) SwitchToLeader ¶
func (self *ReplicationManager) SwitchToLeader() error
func (*ReplicationManager) WaitInitSynced ¶
func (self *ReplicationManager) WaitInitSynced(waiter chan bool)
func (*ReplicationManager) WaitServerSynced ¶
func (self *ReplicationManager) WaitServerSynced() error
func (*ReplicationManager) WakeupServerChannel ¶
func (self *ReplicationManager) WakeupServerChannel() error
type ReplicationServer ¶
type ReplicationServer struct {
// contains filtered or unexported fields
}
func NewReplicationServer ¶
func NewReplicationServer(manager *ReplicationManager, serverProtocol *BinaryServerProtocol) *ReplicationServer
func (*ReplicationServer) Close ¶
func (self *ReplicationServer) Close() error
func (*ReplicationServer) RecvProcess ¶
func (self *ReplicationServer) RecvProcess() error
func (*ReplicationServer) SendProcess ¶
func (self *ReplicationServer) SendProcess() error
type ReplicationServerState ¶
type ReplicationServerState struct {
// contains filtered or unexported fields
}
type SLock ¶
type SLock struct {
// contains filtered or unexported fields
}
func NewSLock ¶
func NewSLock(config *ServerConfig, logger logging.Logger) *SLock
func (*SLock) GetArbiterManager ¶
func (self *SLock) GetArbiterManager() *ArbiterManager
func (*SLock) GetOrNewDB ¶
func (*SLock) GetReplicationManager ¶
func (self *SLock) GetReplicationManager() *ReplicationManager
func (*SLock) GetState ¶
func (self *SLock) GetState(serverProtocol ServerProtocol, command *protocol.StateCommand) error
func (*SLock) GetSubscribeManager ¶
func (self *SLock) GetSubscribeManager() *SubscribeManager
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CloseStreams ¶
func (*Server) GetStreams ¶
type ServerConfig ¶
type ServerConfig struct { Conf string `toml:"conf" long:"conf" description:"toml conf filename" default:""` Bind string `toml:"bind" long:"bind" description:"bind address" default:"127.0.0.1"` Port uint `toml:"port" long:"port" description:"bind port" default:"5658"` Log string `toml:"log" long:"log" description:"log filename, default is output stdout" default:"-"` LogLevel string `` /* 133-byte string literal not displayed */ LogRotatingSize uint `toml:"log_rotating_size" long:"log_rotating_size" description:"log rotating byte size" default:"67108864"` LogBackupCount uint `toml:"log_backup_count" long:"log_backup_count" description:"log backup count" default:"5"` LogBufferSize uint `toml:"log_buffer_size" long:"log_buffer_size" description:"log buffer byte size" default:"0"` LogBufferFlushTime uint `toml:"log_buffer_flush_time" long:"log_buffer_flush_time" description:"log buffer flush seconds time" default:"1"` DataDir string `toml:"data_dir" long:"data_dir" description:"data dir" default:"./data/"` DBFastKeyCount uint `toml:"db_fast_key_count" long:"db_fast_key_count" description:"db fast key count" default:"4194304"` DBConcurrent uint `toml:"db_concurrent" long:"db_concurrent" description:"db concurrent count" default:"8"` DBLockAofTime uint `toml:"db_lock_aof_time" long:"db_lock_aof_time" description:"db lock aof time" default:"1"` DBLockAofParcentTime float64 `toml:"db_lock_aof_parcent_time" long:"db_lock_aof_parcent_time" description:"db lock aof parcent expried time" default:"0.3"` AofQueueSize uint `toml:"aof_queue_size" long:"aof_queue_size" description:"aof channel queue size" default:"65536"` AofFileRewriteSize uint `toml:"aof_file_rewrite_size" long:"aof_file_rewrite_size" description:"aof file rewrite size" default:"67174400"` AofFileBufferSize uint `toml:"aof_file_buffer_size" long:"aof_file_buffer_size" description:"aof file buffer size" default:"4096"` AofRingBufferSize uint `toml:"aof_ring_buffer_size" long:"aof_ring_buffer_size" description:"slave sync ring buffer size" default:"4194304"` AofRingBufferMaxSize uint `` /* 129-byte string literal not displayed */ SlaveOf string `toml:"slaveof" long:"slaveof" description:"slave of to master sync" default:""` ReplSet string `toml:"replset" long:"replset" description:"replset name, start replset mode when it set" default:""` }
var Config *ServerConfig = nil
func ExtendConfig ¶
func ExtendConfig(config *ServerConfig, oconfig *ServerConfig) *ServerConfig
func GetConfig ¶
func GetConfig() *ServerConfig
type ServerProtocol ¶
type ServerProtocol interface { Init(clientId [16]byte) error Lock() Unlock() Read() (protocol.CommandDecode, error) Write(protocol.CommandEncode) error ReadCommand() (protocol.CommandDecode, error) WriteCommand(protocol.CommandEncode) error Process() error ProcessParse(buf []byte) error ProcessBuild(command protocol.ICommand) error ProcessCommad(command protocol.ICommand) error ProcessLockCommand(command *protocol.LockCommand) error ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error Close() error GetStream() *Stream GetProxy() *ProxyServerProtocol AddProxy(proxy *ProxyServerProtocol) error RemoteAddr() net.Addr GetLockCommand() *protocol.LockCommand GetLockCommandLocked() *protocol.LockCommand FreeLockCommand(command *protocol.LockCommand) error FreeLockCommandLocked(command *protocol.LockCommand) error }
type ServerProtocolSession ¶
type ServerProtocolSession struct {
// contains filtered or unexported fields
}
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) ReadBytesFrame ¶
func (*Stream) RemoteAddr ¶
func (*Stream) WriteBytes ¶
type StreamReaderBuffer ¶
type StreamReaderBuffer struct {
// contains filtered or unexported fields
}
func NewStreamReaderBuffer ¶
func NewStreamReaderBuffer(size int) *StreamReaderBuffer
func (*StreamReaderBuffer) GetCapSize ¶
func (self *StreamReaderBuffer) GetCapSize() int
func (*StreamReaderBuffer) GetSize ¶
func (self *StreamReaderBuffer) GetSize() int
func (*StreamReaderBuffer) Read ¶
func (self *StreamReaderBuffer) Read(buf []byte) int
func (*StreamReaderBuffer) ReadBytesSize ¶
func (self *StreamReaderBuffer) ReadBytesSize(size int) []byte
func (*StreamReaderBuffer) ReadFromConn ¶
type SubscribeBuffer ¶
type SubscribeBuffer struct {
// contains filtered or unexported fields
}
type SubscribeChannel ¶
type SubscribeChannel struct {
// contains filtered or unexported fields
}
func NewSubscribeChannel ¶
func NewSubscribeChannel(manager *SubscribeManager, lockDb *LockDB, lockDbGlockIndex uint16, lockDbGlock *PriorityMutex) *SubscribeChannel
func (*SubscribeChannel) ClientPush ¶
func (self *SubscribeChannel) ClientPush(lock *PublishLock) error
func (*SubscribeChannel) Push ¶
func (self *SubscribeChannel) Push(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*SubscribeChannel) Run ¶
func (self *SubscribeChannel) Run()
type SubscribeClient ¶
type SubscribeClient struct {
// contains filtered or unexported fields
}
func NewSubscribeClient ¶
func NewSubscribeClient(manager *SubscribeManager) *SubscribeClient
func (*SubscribeClient) Close ¶
func (self *SubscribeClient) Close() error
func (*SubscribeClient) Open ¶
func (self *SubscribeClient) Open(leaderAddress string) error
func (*SubscribeClient) Process ¶
func (self *SubscribeClient) Process() error
func (*SubscribeClient) Run ¶
func (self *SubscribeClient) Run()
func (*SubscribeClient) WakeupRetryConnect ¶
func (self *SubscribeClient) WakeupRetryConnect() error
type SubscribeManager ¶
type SubscribeManager struct {
// contains filtered or unexported fields
}
func NewSubscribeManager ¶
func NewSubscribeManager() *SubscribeManager
func (*SubscribeManager) ChangeLeader ¶
func (self *SubscribeManager) ChangeLeader(address string) error
func (*SubscribeManager) Close ¶
func (self *SubscribeManager) Close()
func (*SubscribeManager) CloseSubscribeChannel ¶
func (self *SubscribeManager) CloseSubscribeChannel(aofChannel *SubscribeChannel) *SubscribeChannel
func (*SubscribeManager) NewSubscribeChannel ¶
func (self *SubscribeManager) NewSubscribeChannel(lockDb *LockDB, lockDbGlockIndex uint16, lockDbGlock *PriorityMutex) *SubscribeChannel
func (*SubscribeManager) RemoveSubscribeChannel ¶
func (self *SubscribeManager) RemoveSubscribeChannel(aofChannel *SubscribeChannel) *SubscribeChannel
func (*SubscribeManager) WaitFlushSubscribeChannel ¶
func (self *SubscribeManager) WaitFlushSubscribeChannel() error
type SubscribePublishLockQueue ¶
type SubscribePublishLockQueue struct {
// contains filtered or unexported fields
}
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber(manager *SubscribeManager, serverProtocol ServerProtocol, clientId uint32, subscriberId uint32) *Subscriber
func (*Subscriber) Close ¶
func (self *Subscriber) Close() error
func (*Subscriber) Push ¶
func (self *Subscriber) Push(lock *PublishLock) error
func (*Subscriber) Run ¶
func (self *Subscriber) Run()
func (*Subscriber) Update ¶
func (self *Subscriber) Update(serverProtocol ServerProtocol, subscriberType uint8, publishId [16]byte, expried uint32, maxSize uint32) error
type TextServerProtocol ¶
type TextServerProtocol struct {
// contains filtered or unexported fields
}
func NewTextServerProtocol ¶
func NewTextServerProtocol(slock *SLock, stream *Stream) *TextServerProtocol
func (*TextServerProtocol) AddProxy ¶
func (self *TextServerProtocol) AddProxy(proxy *ProxyServerProtocol) error
func (*TextServerProtocol) ArgsToLockComand ¶
func (self *TextServerProtocol) ArgsToLockComand(args []string) (*protocol.LockCommand, error)
func (*TextServerProtocol) ArgsToLockComandParseId ¶
func (self *TextServerProtocol) ArgsToLockComandParseId(argId string, lockId *[16]byte)
func (*TextServerProtocol) Close ¶
func (self *TextServerProtocol) Close() error
func (*TextServerProtocol) FindHandler ¶
func (self *TextServerProtocol) FindHandler(name string) (TextServerProtocolCommandHandler, error)
func (*TextServerProtocol) FreeLockCommand ¶
func (self *TextServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
func (*TextServerProtocol) FreeLockCommandLocked ¶
func (self *TextServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
func (*TextServerProtocol) GetLockCommand ¶
func (self *TextServerProtocol) GetLockCommand() *protocol.LockCommand
func (*TextServerProtocol) GetLockCommandLocked ¶
func (self *TextServerProtocol) GetLockCommandLocked() *protocol.LockCommand
func (*TextServerProtocol) GetParser ¶
func (self *TextServerProtocol) GetParser() *protocol.TextParser
func (*TextServerProtocol) GetProxy ¶
func (self *TextServerProtocol) GetProxy() *ProxyServerProtocol
func (*TextServerProtocol) GetRequestId ¶
func (self *TextServerProtocol) GetRequestId() [16]byte
func (*TextServerProtocol) GetStream ¶
func (self *TextServerProtocol) GetStream() *Stream
func (*TextServerProtocol) Init ¶
func (self *TextServerProtocol) Init(_ [16]byte) error
func (*TextServerProtocol) InitLockCommand ¶
func (self *TextServerProtocol) InitLockCommand()
func (*TextServerProtocol) Lock ¶
func (self *TextServerProtocol) Lock()
func (*TextServerProtocol) Process ¶
func (self *TextServerProtocol) Process() error
func (*TextServerProtocol) ProcessBuild ¶
func (self *TextServerProtocol) ProcessBuild(command protocol.ICommand) error
func (*TextServerProtocol) ProcessCommad ¶
func (self *TextServerProtocol) ProcessCommad(command protocol.ICommand) error
func (*TextServerProtocol) ProcessLockCommand ¶
func (self *TextServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
func (*TextServerProtocol) ProcessLockResultCommand ¶
func (self *TextServerProtocol) ProcessLockResultCommand(lockCommand *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*TextServerProtocol) ProcessLockResultCommandLocked ¶
func (self *TextServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*TextServerProtocol) ProcessParse ¶
func (self *TextServerProtocol) ProcessParse(buf []byte) error
func (*TextServerProtocol) Read ¶
func (self *TextServerProtocol) Read() (protocol.CommandDecode, error)
func (*TextServerProtocol) ReadCommand ¶
func (self *TextServerProtocol) ReadCommand() (protocol.CommandDecode, error)
func (*TextServerProtocol) RemoteAddr ¶
func (self *TextServerProtocol) RemoteAddr() net.Addr
func (*TextServerProtocol) RunCommand ¶
func (self *TextServerProtocol) RunCommand() error
func (*TextServerProtocol) UnInitLockCommand ¶
func (self *TextServerProtocol) UnInitLockCommand()
func (*TextServerProtocol) Unlock ¶
func (self *TextServerProtocol) Unlock()
func (*TextServerProtocol) Write ¶
func (self *TextServerProtocol) Write(result protocol.CommandEncode) error
func (*TextServerProtocol) WriteCommand ¶
func (self *TextServerProtocol) WriteCommand(result protocol.CommandEncode) error
type TextServerProtocolCommandHandler ¶
type TextServerProtocolCommandHandler func(*TextServerProtocol, []string) error
type TransparencyBinaryClientProtocol ¶
type TransparencyBinaryClientProtocol struct {
// contains filtered or unexported fields
}
func NewTransparencyBinaryClientProtocol ¶
func NewTransparencyBinaryClientProtocol(manager *TransparencyManager) *TransparencyBinaryClientProtocol
func (*TransparencyBinaryClientProtocol) Close ¶
func (self *TransparencyBinaryClientProtocol) Close() error
func (*TransparencyBinaryClientProtocol) Open ¶
func (self *TransparencyBinaryClientProtocol) Open(leaderAddress string) error
func (*TransparencyBinaryClientProtocol) Process ¶
func (self *TransparencyBinaryClientProtocol) Process()
func (*TransparencyBinaryClientProtocol) RetryOpen ¶
func (self *TransparencyBinaryClientProtocol) RetryOpen(leaderAddress string) error
type TransparencyBinaryServerProtocol ¶
type TransparencyBinaryServerProtocol struct {
// contains filtered or unexported fields
}
func NewTransparencyBinaryServerProtocol ¶
func NewTransparencyBinaryServerProtocol(slock *SLock, stream *Stream, serverProtocol *BinaryServerProtocol) *TransparencyBinaryServerProtocol
func (*TransparencyBinaryServerProtocol) AddProxy ¶
func (self *TransparencyBinaryServerProtocol) AddProxy(proxy *ProxyServerProtocol) error
func (*TransparencyBinaryServerProtocol) CheckClient ¶
func (self *TransparencyBinaryServerProtocol) CheckClient() (*TransparencyBinaryClientProtocol, error)
func (*TransparencyBinaryServerProtocol) Close ¶
func (self *TransparencyBinaryServerProtocol) Close() error
func (*TransparencyBinaryServerProtocol) FreeLockCommand ¶
func (self *TransparencyBinaryServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
func (*TransparencyBinaryServerProtocol) FreeLockCommandLocked ¶
func (self *TransparencyBinaryServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
func (*TransparencyBinaryServerProtocol) GetLockCommand ¶
func (self *TransparencyBinaryServerProtocol) GetLockCommand() *protocol.LockCommand
func (*TransparencyBinaryServerProtocol) GetLockCommandLocked ¶
func (self *TransparencyBinaryServerProtocol) GetLockCommandLocked() *protocol.LockCommand
func (*TransparencyBinaryServerProtocol) GetProxy ¶
func (self *TransparencyBinaryServerProtocol) GetProxy() *ProxyServerProtocol
func (*TransparencyBinaryServerProtocol) GetStream ¶
func (self *TransparencyBinaryServerProtocol) GetStream() *Stream
func (*TransparencyBinaryServerProtocol) Init ¶
func (self *TransparencyBinaryServerProtocol) Init(clientId [16]byte) error
func (*TransparencyBinaryServerProtocol) InitLockCommand ¶
func (self *TransparencyBinaryServerProtocol) InitLockCommand()
func (*TransparencyBinaryServerProtocol) Lock ¶
func (self *TransparencyBinaryServerProtocol) Lock()
func (*TransparencyBinaryServerProtocol) Process ¶
func (self *TransparencyBinaryServerProtocol) Process() error
func (*TransparencyBinaryServerProtocol) ProcessBuild ¶
func (self *TransparencyBinaryServerProtocol) ProcessBuild(command protocol.ICommand) error
func (*TransparencyBinaryServerProtocol) ProcessCommad ¶
func (self *TransparencyBinaryServerProtocol) ProcessCommad(command protocol.ICommand) error
func (*TransparencyBinaryServerProtocol) ProcessLockCommand ¶
func (self *TransparencyBinaryServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
func (*TransparencyBinaryServerProtocol) ProcessLockResultCommand ¶
func (self *TransparencyBinaryServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*TransparencyBinaryServerProtocol) ProcessLockResultCommandLocked ¶
func (self *TransparencyBinaryServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*TransparencyBinaryServerProtocol) ProcessParse ¶
func (self *TransparencyBinaryServerProtocol) ProcessParse(buf []byte) error
func (*TransparencyBinaryServerProtocol) Read ¶
func (self *TransparencyBinaryServerProtocol) Read() (protocol.CommandDecode, error)
func (*TransparencyBinaryServerProtocol) ReadCommand ¶
func (self *TransparencyBinaryServerProtocol) ReadCommand() (protocol.CommandDecode, error)
func (*TransparencyBinaryServerProtocol) RemoteAddr ¶
func (self *TransparencyBinaryServerProtocol) RemoteAddr() net.Addr
func (*TransparencyBinaryServerProtocol) UnInitLockCommand ¶
func (self *TransparencyBinaryServerProtocol) UnInitLockCommand()
func (*TransparencyBinaryServerProtocol) Unlock ¶
func (self *TransparencyBinaryServerProtocol) Unlock()
func (*TransparencyBinaryServerProtocol) Write ¶
func (self *TransparencyBinaryServerProtocol) Write(result protocol.CommandEncode) error
func (*TransparencyBinaryServerProtocol) WriteCommand ¶
func (self *TransparencyBinaryServerProtocol) WriteCommand(result protocol.CommandEncode) error
type TransparencyManager ¶
type TransparencyManager struct {
// contains filtered or unexported fields
}
func NewTransparencyManager ¶
func NewTransparencyManager() *TransparencyManager
func (*TransparencyManager) AcquireClient ¶
func (self *TransparencyManager) AcquireClient(serverProtocol ServerProtocol) (*TransparencyBinaryClientProtocol, error)
func (*TransparencyManager) ChangeLeader ¶
func (self *TransparencyManager) ChangeLeader(address string) error
func (*TransparencyManager) CheckArbiterWaiter ¶
func (self *TransparencyManager) CheckArbiterWaiter() int
func (*TransparencyManager) Close ¶
func (self *TransparencyManager) Close() error
func (*TransparencyManager) CloseClient ¶
func (self *TransparencyManager) CloseClient(binaryClient *TransparencyBinaryClientProtocol) error
func (*TransparencyManager) OpenClient ¶
func (self *TransparencyManager) OpenClient(initCommand *protocol.InitCommand) (*TransparencyBinaryClientProtocol, error)
func (*TransparencyManager) ReleaseClient ¶
func (self *TransparencyManager) ReleaseClient(binaryClient *TransparencyBinaryClientProtocol) error
func (*TransparencyManager) Run ¶
func (self *TransparencyManager) Run()
func (*TransparencyManager) Wakeup ¶
func (self *TransparencyManager) Wakeup()
type TransparencyTextServerProtocol ¶
type TransparencyTextServerProtocol struct {
// contains filtered or unexported fields
}
func NewTransparencyTextServerProtocol ¶
func NewTransparencyTextServerProtocol(slock *SLock, stream *Stream, serverProtocol *TextServerProtocol) *TransparencyTextServerProtocol
func (*TransparencyTextServerProtocol) AddProxy ¶
func (self *TransparencyTextServerProtocol) AddProxy(proxy *ProxyServerProtocol) error
func (*TransparencyTextServerProtocol) CheckClient ¶
func (self *TransparencyTextServerProtocol) CheckClient() (*TransparencyBinaryClientProtocol, error)
func (*TransparencyTextServerProtocol) Close ¶
func (self *TransparencyTextServerProtocol) Close() error
func (*TransparencyTextServerProtocol) FindHandler ¶
func (self *TransparencyTextServerProtocol) FindHandler(name string) (TextServerProtocolCommandHandler, error)
func (*TransparencyTextServerProtocol) FreeLockCommand ¶
func (self *TransparencyTextServerProtocol) FreeLockCommand(command *protocol.LockCommand) error
func (*TransparencyTextServerProtocol) FreeLockCommandLocked ¶
func (self *TransparencyTextServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error
func (*TransparencyTextServerProtocol) GetLockCommand ¶
func (self *TransparencyTextServerProtocol) GetLockCommand() *protocol.LockCommand
func (*TransparencyTextServerProtocol) GetLockCommandLocked ¶
func (self *TransparencyTextServerProtocol) GetLockCommandLocked() *protocol.LockCommand
func (*TransparencyTextServerProtocol) GetParser ¶
func (self *TransparencyTextServerProtocol) GetParser() *protocol.TextParser
func (*TransparencyTextServerProtocol) GetProxy ¶
func (self *TransparencyTextServerProtocol) GetProxy() *ProxyServerProtocol
func (*TransparencyTextServerProtocol) GetStream ¶
func (self *TransparencyTextServerProtocol) GetStream() *Stream
func (*TransparencyTextServerProtocol) Init ¶
func (self *TransparencyTextServerProtocol) Init(_ [16]byte) error
func (*TransparencyTextServerProtocol) InitLockCommand ¶
func (self *TransparencyTextServerProtocol) InitLockCommand()
func (*TransparencyTextServerProtocol) Lock ¶
func (self *TransparencyTextServerProtocol) Lock()
func (*TransparencyTextServerProtocol) Process ¶
func (self *TransparencyTextServerProtocol) Process() error
func (*TransparencyTextServerProtocol) ProcessBuild ¶
func (self *TransparencyTextServerProtocol) ProcessBuild(command protocol.ICommand) error
func (*TransparencyTextServerProtocol) ProcessCommad ¶
func (self *TransparencyTextServerProtocol) ProcessCommad(command protocol.ICommand) error
func (*TransparencyTextServerProtocol) ProcessLockCommand ¶
func (self *TransparencyTextServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error
func (*TransparencyTextServerProtocol) ProcessLockResultCommand ¶
func (self *TransparencyTextServerProtocol) ProcessLockResultCommand(lockCommand *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*TransparencyTextServerProtocol) ProcessLockResultCommandLocked ¶
func (self *TransparencyTextServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
func (*TransparencyTextServerProtocol) ProcessParse ¶
func (self *TransparencyTextServerProtocol) ProcessParse(buf []byte) error
func (*TransparencyTextServerProtocol) Read ¶
func (self *TransparencyTextServerProtocol) Read() (protocol.CommandDecode, error)
func (*TransparencyTextServerProtocol) ReadCommand ¶
func (self *TransparencyTextServerProtocol) ReadCommand() (protocol.CommandDecode, error)
func (*TransparencyTextServerProtocol) RemoteAddr ¶
func (self *TransparencyTextServerProtocol) RemoteAddr() net.Addr
func (*TransparencyTextServerProtocol) RunCommand ¶
func (self *TransparencyTextServerProtocol) RunCommand() error
func (*TransparencyTextServerProtocol) UnInitLockCommand ¶
func (self *TransparencyTextServerProtocol) UnInitLockCommand()
func (*TransparencyTextServerProtocol) Unlock ¶
func (self *TransparencyTextServerProtocol) Unlock()
func (*TransparencyTextServerProtocol) Write ¶
func (self *TransparencyTextServerProtocol) Write(result protocol.CommandEncode) error
func (*TransparencyTextServerProtocol) WriteCommand ¶
func (self *TransparencyTextServerProtocol) WriteCommand(result protocol.CommandEncode) error
Click to show internal directories.
Click to hide internal directories.