Documentation ¶
Index ¶
- Constants
- Variables
- func Diag(addr string) (*rpc.Client, error)
- func Hash(str string) big.Int
- func IsIn(ll *big.Int, rr *big.Int, val *big.Int, lClosed bool, rClosed bool) bool
- func LogInit()
- func Ping(addr string) error
- type AddrType
- type BoolStrPair
- type LockMap
- type NodeType
- func (this *NodeType) Create()
- func (this *NodeType) Delete(key string) bool
- func (this *NodeType) Display()
- func (this *NodeType) FixFingers(fixPos *int)
- func (this *NodeType) ForceQuit()
- func (this *NodeType) Get(key string) (founded bool, value string)
- func (this *NodeType) Join(ip string) bool
- func (this *NodeType) Put(key string, value string) bool
- func (this *NodeType) Quit()
- func (this *NodeType) Updating()
- type ReceiverType
- func (this *ReceiverType) BackupDirectlyDelete(args string, reply *bool) error
- func (this *ReceiverType) BackupDirectlyPut(args StrPair, reply *bool) error
- func (this *ReceiverType) Delete(args string, reply *bool) error
- func (this *ReceiverType) DirectlyDelete(args string, reply *bool) error
- func (this *ReceiverType) DirectlyPut(args StrPair, reply *bool) error
- func (this ReceiverType) FindSuccessor(args *big.Int, reply *AddrType) error
- func (this *ReceiverType) Get(args string, reply *BoolStrPair) error
- func (this *ReceiverType) GetData(_ int, reply *map[string]string) error
- func (this ReceiverType) GetPredecessor(_ int, reply *AddrType) error
- func (this ReceiverType) GetSuccList(_ int, reply *SuccListType) error
- func (this *ReceiverType) MergeIntoBackup(args map[string]string, _ *int) error
- func (this *ReceiverType) MergeIntoData(args map[string]string, _ *int) error
- func (this *ReceiverType) MoveFromData(args []string, _ *int) error
- func (this *ReceiverType) Notify(args *AddrType, _ *int) error
- func (this *ReceiverType) PredecessorUpdate(args *AddrType, _ *int) error
- func (this *ReceiverType) Put(args StrPair, reply *bool) error
- func (this *ReceiverType) SuccListUpdate(args *AddrType, _ *int) error
- func (this *ReceiverType) UpdateBackup(args map[string]string, reply *int) error
- type StrPair
- type SuccListType
Constants ¶
View Source
const ( M = 160 SuccListLen = 10 UpdateInterval = 50 * time.Millisecond RemoteTryTime = 3 RemoteTryInterval = 25 * time.Millisecond )
Variables ¶
View Source
var Log = logrus.New()
Functions ¶
Types ¶
type BoolStrPair ¶
type NodeType ¶
func (*NodeType) Create ¶
func (this *NodeType) Create()
Create the Network in NodeType: pre and suc <- self
func (*NodeType) FixFingers ¶
FixFingers fixPos is the index to fix, every time fixPos++ to fix the next pos
type ReceiverType ¶
func NewReceiver ¶
func NewReceiver(ip string) *ReceiverType
func (*ReceiverType) BackupDirectlyDelete ¶
func (this *ReceiverType) BackupDirectlyDelete(args string, reply *bool) error
func (*ReceiverType) BackupDirectlyPut ¶
func (this *ReceiverType) BackupDirectlyPut(args StrPair, reply *bool) error
func (*ReceiverType) DirectlyDelete ¶
func (this *ReceiverType) DirectlyDelete(args string, reply *bool) error
func (*ReceiverType) DirectlyPut ¶
func (this *ReceiverType) DirectlyPut(args StrPair, reply *bool) error
func (ReceiverType) FindSuccessor ¶
func (this ReceiverType) FindSuccessor(args *big.Int, reply *AddrType) error
func (*ReceiverType) Get ¶
func (this *ReceiverType) Get(args string, reply *BoolStrPair) error
func (*ReceiverType) GetData ¶
func (this *ReceiverType) GetData(_ int, reply *map[string]string) error
func (ReceiverType) GetPredecessor ¶
func (this ReceiverType) GetPredecessor(_ int, reply *AddrType) error
func (ReceiverType) GetSuccList ¶
func (this ReceiverType) GetSuccList(_ int, reply *SuccListType) error
func (*ReceiverType) MergeIntoBackup ¶
func (this *ReceiverType) MergeIntoBackup(args map[string]string, _ *int) error
func (*ReceiverType) MergeIntoData ¶
func (this *ReceiverType) MergeIntoData(args map[string]string, _ *int) error
func (*ReceiverType) MoveFromData ¶
func (this *ReceiverType) MoveFromData(args []string, _ *int) error
func (*ReceiverType) PredecessorUpdate ¶
func (this *ReceiverType) PredecessorUpdate(args *AddrType, _ *int) error
func (*ReceiverType) SuccListUpdate ¶
func (this *ReceiverType) SuccListUpdate(args *AddrType, _ *int) error
func (*ReceiverType) UpdateBackup ¶
func (this *ReceiverType) UpdateBackup(args map[string]string, reply *int) error
type SuccListType ¶
type SuccListType [SuccListLen]AddrType
Click to show internal directories.
Click to hide internal directories.