Documentation ¶
Index ¶
- func New(config *configuration.Configuration) (overlay.Overlay, error)
- type Chord
- func (c *Chord) Create(ctx context.Context, appNode overlay.LocalNode) error
- func (c *Chord) Join(ctx context.Context, overlayNodeIP string, overlayNodePort int, ...) error
- func (c *Chord) Leave(ctx context.Context) error
- func (c *Chord) Lookup(ctx context.Context, key []byte) ([]*overlay.OverlayNode, error)
- func (c *Chord) Neighbors(ctx context.Context, nodeID []byte) ([]*overlay.OverlayNode, error)
- func (c *Chord) NodeID(ctx context.Context) ([]byte, error)
- type Listener
- func (l *Listener) Leaving(local, predecessor, successor *chord.Vnode)
- func (l *Listener) NewPredecessor(local, newPredecessor, previousPredecessor *chord.Vnode)
- func (l *Listener) PredecessorLeaving(local, remote *chord.Vnode)
- func (l *Listener) Shutdown()
- func (l *Listener) SuccessorLeaving(local, remote *chord.Vnode)
- type ResourcesHash
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(config *configuration.Configuration) (overlay.Overlay, error)
new create a new chord overlay structure.
Types ¶
type Chord ¶
type Chord struct {
// contains filtered or unexported fields
}
Chord represents a Chord overlay local (for each node) structure.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Used to handle events fired by the chord overlay. The listener let the important events bubble up into Node layer using a provided interface called LocalNode.
func (*Listener) Leaving ¶
func (l *Listener) Leaving(local, predecessor, successor *chord.Vnode)
Fired when the local node is leaving the chord overlay.
func (*Listener) NewPredecessor ¶
func (l *Listener) NewPredecessor(local, newPredecessor, previousPredecessor *chord.Vnode)
Fired when the a new predecessor of the local node appears in the overlay.
func (*Listener) PredecessorLeaving ¶
func (l *Listener) PredecessorLeaving(local, remote *chord.Vnode)
Fired when the current predecessor of the local node is leaving the chord overlay.
func (*Listener) Shutdown ¶
func (l *Listener) Shutdown()
Fired when when one node decided to shutdown the chord ring system. Do the shutdown message propagates to all the nodes ??
func (*Listener) SuccessorLeaving ¶
func (l *Listener) SuccessorLeaving(local, remote *chord.Vnode)
Fired when a current successor of the local node is leaving the chord overlay.
type ResourcesHash ¶
type ResourcesHash struct {
// contains filtered or unexported fields
}
It is used to pass to the Chord implementation and it does a pass-through hash because we generate our hash in the node layer depending on the resources for a request.
func NewResourcesHash ¶
func NewResourcesHash(bytesSize int, hostname string) *ResourcesHash
NewResourcesHash creates a new hash.
func (*ResourcesHash) BlockSize ¶
func (r *ResourcesHash) BlockSize() int
func (*ResourcesHash) Reset ¶
func (r *ResourcesHash) Reset()
func (*ResourcesHash) Size ¶
func (r *ResourcesHash) Size() int
func (*ResourcesHash) Sum ¶
func (r *ResourcesHash) Sum(b []byte) []byte