chord

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2018 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.2.1

new create a new chord overlay structure.

Types

type Chord added in v0.2.1

type Chord struct {
	// contains filtered or unexported fields
}

Chord represents a Chord overlay local (for each node) structure.

func (*Chord) Create added in v0.2.1

func (co *Chord) Create(ctx context.Context, appNode types.OverlayMembership) error

func (*Chord) Join added in v0.2.1

func (co *Chord) Join(ctx context.Context, overlayNodeIP string, overlayNodePort int, appNode types.OverlayMembership) error

func (*Chord) Leave added in v0.2.1

func (co *Chord) Leave(ctx context.Context) error

func (*Chord) Lookup added in v0.2.1

func (co *Chord) Lookup(ctx context.Context, key []byte) ([]*types.OverlayNode, error)

func (*Chord) Neighbors added in v0.2.1

func (co *Chord) Neighbors(ctx context.Context, nodeID []byte) ([]*types.OverlayNode, error)

func (*Chord) NodeID added in v0.2.1

func (co *Chord) NodeID(ctx context.Context) ([]byte, error)

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 OverlayMembership.

func (*Listener) Leaving

func (cl *Listener) Leaving(local, predecessor, successor *chord.Vnode)

Fired when the local node is leaving the chord overlay.

func (*Listener) NewPredecessor

func (cl *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 (cl *Listener) PredecessorLeaving(local, remote *chord.Vnode)

Fired when the current predecessor of the local node is leaving the chord overlay.

func (*Listener) Shutdown

func (cl *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 (cl *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 (rh *ResourcesHash) BlockSize() int

func (*ResourcesHash) Reset

func (rh *ResourcesHash) Reset()

func (*ResourcesHash) Size

func (rh *ResourcesHash) Size() int

func (*ResourcesHash) Sum

func (rh *ResourcesHash) Sum(b []byte) []byte

func (*ResourcesHash) Write

func (rh *ResourcesHash) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL