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 ¶
- type Cluster
- func (cluster *Cluster) AddNode(req *pb.JoinRequest) *pb.JoinResponse
- func (cluster *Cluster) DeleteArtifacts(req *pb.DeleteRequest)
- func (cluster *Cluster) GetMembers() []*pb.Node
- func (cluster *Cluster) Init(size int)
- func (cluster *Cluster) Join(members []string)
- func (cluster *Cluster) ReplicateArtifacts(req *pb.StoreRequest)
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 ¶
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 ¶
GetMembers returns the set of currently known cache members.
func (*Cluster) ReplicateArtifacts ¶
func (cluster *Cluster) ReplicateArtifacts(req *pb.StoreRequest)
ReplicateArtifacts replicates artifacts from this node to another.