cluster

package
v0.0.0-...-a11d02e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsistentRing

type ConsistentRing struct {
	Hashfunc HashFunc
	Nreplica int
}

Consistent HashRing implementation

func (*ConsistentRing) BuildRing

func (r *ConsistentRing) BuildRing(shards []Shard) *HashRing

Build a consistent HashRing with given shard information

type HashFunc

type HashFunc func([]byte) uint32

type HashRing

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

HashRing object for a clustered connector

func (*HashRing) Get

func (r *HashRing) Get(key []byte) (*Shard, func() *Shard)

Return a shard for a given key with the iterator closure function which could be used by failover logic.

type NodeReader

type NodeReader interface {
	ReadNodes() []Shard
}

type RingBuilder

type RingBuilder interface {
	BuildRing([]Shard) *HashRing
}

type Shard

type Shard struct {
	Name string
	Addr string
}

Jump to

Keyboard shortcuts

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