Documentation ¶
Index ¶
- Variables
- func CalHash(str string) *big.Int
- func GenerateClient(address string) (*rpc.Client, error)
- func GetLocalIP() string
- func IfOnline(address string) bool
- func In(target, low, high *big.Int) bool
- func PlusTwoPower(raw *big.Int, exp int) *big.Int
- func RemoteCall(addr string, serviceMethod string, args interface{}, reply interface{}) error
- func WrappedAccept(server *rpc.Server, lis net.Listener, ptr *Node)
- type DataManager
- type Node
- func (ptr *Node) Create()
- func (ptr *Node) DataSize() int
- func (ptr *Node) Delete(key string) bool
- func (ptr *Node) ForceQuit()
- func (ptr *Node) Get(key string) (bool, string)
- func (ptr *Node) Init(port int)
- func (ptr *Node) Join(addr string) bool
- func (ptr *Node) Ping(addr string) bool
- func (ptr *Node) Put(key string, value string) bool
- func (ptr *Node) Quit()
- func (ptr *Node) Run()
- type Pair
- type RpcNode
- func (ptr *RpcNode) BackupAdd(dataSet *map[string]string, _ *string) error
- func (ptr *RpcNode) BackupDelete(key string, _ *string) error
- func (ptr *RpcNode) BackupRemove(dataSet *map[string]string, _ *string) error
- func (ptr *RpcNode) BackupStore(dataPair Pair, _ *string) error
- func (ptr *RpcNode) DeleteData(key string, _ *string) error
- func (ptr *RpcNode) FindSuccessor(target *big.Int, result *string) error
- func (ptr *RpcNode) FixPredecessor(_ string, _ *string) error
- func (ptr *RpcNode) GenerateBackup(_ string, dataSet *map[string]string) error
- func (ptr *RpcNode) GetData(key string, value *string) error
- func (ptr *RpcNode) GetPredecessor(_ string, result *string) error
- func (ptr *RpcNode) GetSuccessorList(_ string, result *[successorListSize]string) error
- func (ptr *RpcNode) InheritData(preAddr string, dataSet *map[string]string) error
- func (ptr *RpcNode) Notify(addr string, _ *string) error
- func (ptr *RpcNode) Stabilize(_ string, _ *string) error
- func (ptr *RpcNode) StoreData(dataPair Pair, _ *string) error
- type WrapNode
- func (ptr *WrapNode) BackupAdd(dataSet *map[string]string) error
- func (ptr *WrapNode) BackupDelete(key string) error
- func (ptr *WrapNode) BackupRemove(dataSet *map[string]string) error
- func (ptr *WrapNode) BackupStore(data Pair) error
- func (ptr *WrapNode) DeleteData(key string) error
- func (ptr *WrapNode) FindSuccessor(target *big.Int, result *string) error
- func (ptr *WrapNode) FixPredecessor() error
- func (ptr *WrapNode) GenerateBackup(dataSet *map[string]string) error
- func (ptr *WrapNode) GetData(key string, value *string) error
- func (ptr *WrapNode) GetPredecessor(result *string) error
- func (ptr *WrapNode) GetSuccessorList(result *[successorListSize]string) error
- func (ptr *WrapNode) InheritData(preAddr string, preStorage *map[string]string) error
- func (ptr *WrapNode) Notify(target string) error
- func (ptr *WrapNode) Stabilize() error
- func (ptr *WrapNode) StoreData(key string, value string) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetLocalIP ¶
func GetLocalIP() string
func RemoteCall ¶
Types ¶
type DataManager ¶
type DataManager struct {
// contains filtered or unexported fields
}
func (*DataManager) Init ¶
func (ptr *DataManager) Init(targetNode *Node)
type Node ¶
func (*Node) Create ¶
func (ptr *Node) Create()
Create /* "Create" and "Join" are called after calling "Run". */
For a dhtNode, either "Create" or "Join" will be called, but not both.
func (*Node) ForceQuit ¶
func (ptr *Node) ForceQuit()
ForceQuit /* Chord offers a way of "normal" quitting. */
For "force quit", the node quit the network without informing other nodes. "ForceQuit" will be checked by TA manually.
func (*Node) Ping ¶
Ping /* Check whether the node represented by the IP address is in the network. */
func (*Node) Put ¶
Put /* Put a key-value pair into the network (if KEY is already in the network, cover it), or
type RpcNode ¶
type RpcNode struct {
// contains filtered or unexported fields
}
func (*RpcNode) BackupRemove ¶
func (*RpcNode) FindSuccessor ¶
func (*RpcNode) GenerateBackup ¶
func (*RpcNode) GetSuccessorList ¶
func (*RpcNode) InheritData ¶
type WrapNode ¶
type WrapNode struct {
// contains filtered or unexported fields
}
func GenerateWrapNode ¶
func (*WrapNode) BackupDelete ¶
func (*WrapNode) BackupStore ¶
func (*WrapNode) DeleteData ¶
func (*WrapNode) FindSuccessor ¶
func (*WrapNode) FixPredecessor ¶
func (*WrapNode) GenerateBackup ¶
func (*WrapNode) GetPredecessor ¶
func (*WrapNode) GetSuccessorList ¶
func (*WrapNode) InheritData ¶
Click to show internal directories.
Click to hide internal directories.