Documentation
¶
Index ¶
- Constants
- Variables
- func CreatePerfectFingertable(forNodeAddr string, otherNodes []string) (fingerTable [M]string)
- func CreatePerfectSuccessorList(forNodeAddr string, otherNodes []string) (successors []string)
- func GetGRPCConnection(addr string) (conn *grpc.ClientConn)
- type ChordServer
- func (s *ChordServer) Address() string
- func (s *ChordServer) Delete(key string) error
- func (s *ChordServer) Get(key string) (value string, err error)
- func (s *ChordServer) Join(otherNode *string)
- func (s *ChordServer) ListenAndServe() error
- func (s *ChordServer) Set(key string, value string) error
- func (s *ChordServer) Stop()
Constants ¶
View Source
const ( TICK_STABILISE = 1000 * time.Millisecond TICK_FIX_FINGERS = 1000 * time.Millisecond // M as it is used in the paper. M specifies the size of the identifier ring, // which is 2^M in size (M specifies the amount of bits in an identifier). // It is chosen to be the amount of bits we receive from the hashing function. M uint = hash.Size * 8 // R is supposed to be log_2(N) where N is the number of nodes. // however, we don't know the number of nodes... R uint = 5 )
Variables ¶
View Source
var IntelligentFixFingers bool
IntelligentFixFingers specifies whether we try to smartly fix fingers
View Source
var LearnNodes bool
LearnNodes specifies whether we want to aggresively learn new nodes for finger table
View Source
var LogHopCounts bool
LogHopCounts determines whether we should the amount of hops it takes to find a predecessor
Functions ¶
func GetGRPCConnection ¶
func GetGRPCConnection(addr string) (conn *grpc.ClientConn)
Types ¶
type ChordServer ¶
type ChordServer struct {
// contains filtered or unexported fields
}
func (*ChordServer) Address ¶
func (s *ChordServer) Address() string
func (*ChordServer) Delete ¶
func (s *ChordServer) Delete(key string) error
func (*ChordServer) Join ¶
func (s *ChordServer) Join(otherNode *string)
func (*ChordServer) ListenAndServe ¶
func (s *ChordServer) ListenAndServe() error
func (*ChordServer) Stop ¶
func (s *ChordServer) Stop()
Click to show internal directories.
Click to hide internal directories.