Documentation ¶
Index ¶
- func GetPhysicalNode(vn string) (int, error)
- func Start(nodeID int)
- type MonitorInfo
- type Node
- func (n *Node) AssignCoordinator(request *message.Request, reply *message.Reply) error
- func (n *Node) DeleteSecret(request *message.Request, reply *message.Reply) error
- func (n *Node) GetAllSecrets(request *message.Request, reply *message.Reply) error
- func (n *Node) GetData(request *message.Request, reply *message.Reply) error
- func (n *Node) GetSecrets(request *message.Request, reply *message.Reply) error
- func (n *Node) OwnerNodeDown(request *message.Request, reply *message.Reply) error
- func (n *Node) PerformEventualReplication(request *message.Request, reply *message.Reply) error
- func (n *Node) PerformStrictDown(request *message.Request, reply *message.Reply) error
- func (n *Node) RelayDeleteSecret(request *message.Request, reply *message.Reply) error
- func (n *Node) RemoveCoordinator(request *message.Request, reply *message.Reply) error
- func (n *Node) StoreAndReplicate(request *message.Request, reply *message.Reply) error
- func (n *Node) StrictReplication(request *message.Request, reply *message.Reply) error
- func (n *Node) UpdateHeartbeatTable(request *message.Request, reply *message.Reply) error
- func (n *Node) UpdateRpcMap(request *message.Request, reply *message.Reply) error
- func (n *Node) UpdateVirtualNodes(request *message.Request, reply *message.Reply) error
- type RouterBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPhysicalNode ¶
Find physical node int from virtual node string
Types ¶
type MonitorInfo ¶
type Node ¶
type Node struct { IsCoordinator bool `validate:"required"` Pid int `validate:"gte=0"` // Node ID Ring []int `validate:"required"` // Ring structure of nodes RpcMap map[int]string `validate:"required"` // Map node ID to their receiving address HeartBeatTable map[int]bool VirtualNodeLocation []int VirtualNodeMap map[int]string Router *echo.Echo KillSignal chan os.Signal // For signalling shutdown of router server }
Node contains all the variables that are necessary to manage a node
func (*Node) AssignCoordinator ¶
AssignCoordinator assigns the current node to be the coordinator and starts the router
func (*Node) DeleteSecret ¶
func (*Node) GetAllSecrets ¶
func (*Node) GetSecrets ¶
GetSecrets gets the secrets from given range and send back
func (*Node) OwnerNodeDown ¶
receives the message from Coordinator and do what is on the board REMEMBER to capitalize the function name Strict Consistency with R = 2. Send ACK directly to coordinator
func (*Node) PerformEventualReplication ¶
Performed by rf=1
func (*Node) PerformStrictDown ¶
func (*Node) RelayDeleteSecret ¶
RelayDeleteSecret deletes a copy of the secret
func (*Node) RemoveCoordinator ¶
RemoveCoordinator removes the coordinator flag from this node and stop its router
func (*Node) StoreAndReplicate ¶
Take in list from Coordinator and trigger Store and Replicate processes. Store data to itself and send message to next data on the list to conduct strict consistency
func (*Node) StrictReplication ¶
func (*Node) UpdateHeartbeatTable ¶
UpdateHeartbeatTable updates the Heartbeat Table that the node has
func (*Node) UpdateRpcMap ¶
UpdateRpcMap updates node's RPC Map
type RouterBuilder ¶
type RouterBuilder struct{}
func (*RouterBuilder) New ¶
func (rb *RouterBuilder) New() *echo.Echo