Documentation
¶
Index ¶
- func Start()
- type LockSmith
- func (locksmith *LockSmith) AcquireUserLock(request *message.Request, reply *message.Reply) error
- func (locksmith *LockSmith) CreateVirtualNodes(request *message.Request, reply *message.Reply) error
- func (locksmith *LockSmith) ReleaseUserLock(request *message.Request, reply *message.Reply) error
- func (locksmith *LockSmith) SignalStart(request *message.Request, reply *message.Reply) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LockSmith ¶
type LockSmith struct {
Pid int // Node ID
Ring []int // Ring structure of nodes
Coordinator int // Indicate the coordinator node number
RpcMap map[int]string // Map node ID to their receiving address
HeartBeatTable map[int]bool
VirtualNodeLocation []int
VirtualNodeMap map[int]string
RequestQueue []int // Request queue for granting lock for accessing user.json, an array of nodeID
}
func (*LockSmith) AcquireUserLock ¶
AcquireUserLock puts the request into the queue and serves the request one by one in FIFO order
func (*LockSmith) CreateVirtualNodes ¶
func (locksmith *LockSmith) CreateVirtualNodes(request *message.Request, reply *message.Reply) error
GetHeartbeatTable returns the heartbeat table as a RPC reply
func (*LockSmith) ReleaseUserLock ¶
ReleaseUserLock pop the top request from the queue
Click to show internal directories.
Click to hide internal directories.