cluster

package
v13.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package cluster contains functions for dealing with a cluster of plz cache nodes.

Clustering the cache provides redundancy and increased performance for large caches. Right now the functionality is a little limited, there's no online rehashing so the size must be declared and fixed up front, and the replication factor is fixed at 2. There's an assumption that while nodes might restart, they return with the same name which we use to re-identify them.

The general approach here errs heavily on the side of simplicity and less on zero-downtime reliability since, at the end of the day, this is only a cache server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

A Cluster handles communication between a set of clustered cache servers.

func NewCluster

func NewCluster(port, rpcPort int, name, advertiseAddr string) *Cluster

NewCluster creates a new Cluster object and starts listening on the given port.

func (*Cluster) AddNode

func (cluster *Cluster) AddNode(req *pb.JoinRequest) *pb.JoinResponse

AddNode adds a new node that's applying to join the cluster.

func (*Cluster) DeleteArtifacts

func (cluster *Cluster) DeleteArtifacts(req *pb.DeleteRequest)

DeleteArtifacts deletes artifacts from all other nodes.

func (*Cluster) GetMembers

func (cluster *Cluster) GetMembers() []*pb.Node

GetMembers returns the set of currently known cache members.

func (*Cluster) Init

func (cluster *Cluster) Init(size int)

Init seeds a new plz cache cluster.

func (*Cluster) Join

func (cluster *Cluster) Join(members []string)

Join joins an existing plz cache cluster.

func (*Cluster) ReplicateArtifacts

func (cluster *Cluster) ReplicateArtifacts(req *pb.StoreRequest)

ReplicateArtifacts replicates artifacts from this node to another.

Jump to

Keyboard shortcuts

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