Documentation ¶
Index ¶
- Variables
- func GetUUIDSeq(m map[string]map[string]map[string]cbgt.UUIDSeq, ...) (uuidSeq cbgt.UUIDSeq, uuidSeqExists bool)
- func SetUUIDSeq(m map[string]map[string]map[string]cbgt.UUIDSeq, ...) (uuidSeqPrev cbgt.UUIDSeq, uuidSeqPrevExists bool)
- type CurrSeqs
- type CurrStates
- type RebalanceLogFunc
- type RebalanceOptions
- type RebalanceProgress
- type Rebalancer
- type StateOp
- type VisitFunc
- type WantSeqs
Constants ¶
This section is empty.
Variables ¶
var ErrorNotPausable = errors.New("not pausable")
var ErrorNotResumable = errors.New("not resumable")
Functions ¶
func GetUUIDSeq ¶
func GetUUIDSeq( m map[string]map[string]map[string]cbgt.UUIDSeq, pindex, sourcePartition, node string) ( uuidSeq cbgt.UUIDSeq, uuidSeqExists bool)
GetUUIDSeq returns the cbgt.UUIDSeq for a pindex/sourcePartition/node.
func SetUUIDSeq ¶
func SetUUIDSeq( m map[string]map[string]map[string]cbgt.UUIDSeq, pindex, sourcePartition, node string, uuid string, seq uint64) ( uuidSeqPrev cbgt.UUIDSeq, uuidSeqPrevExists bool)
SetUUIDSeq updates the cbgt.UUIDSeq for a pindex/sourcePartition/node, and returns the previous cbgt.UUIDSeq.
Types ¶
type CurrStates ¶
Map of index -> pindex -> node -> StateOp.
type RebalanceLogFunc ¶
type RebalanceLogFunc func(format string, v ...interface{})
type RebalanceOptions ¶
type RebalanceOptions struct { // See blance.CalcPartitionMoves(favorMinNodes). FavorMinNodes bool DryRun bool // When true, no changes, for analysis/planning. Log RebalanceLogFunc Verbose int // Optional, defaults to http.Get(); this is used, for example, // for unit testing. HttpGet func(url string) (resp *http.Response, err error) }
type RebalanceProgress ¶
type RebalanceProgress struct { Error error Index string OrchestratorProgress blance.OrchestratorProgress }
RebalanceProgress represents progress status information as the Rebalance() operation proceeds.
type Rebalancer ¶
type Rebalancer struct {
// contains filtered or unexported fields
}
A Rebalancer struct holds all the tracking information for the Rebalance operation.
func StartRebalance ¶
func StartRebalance(version string, cfg cbgt.Cfg, server string, nodesToRemoveParam []string, options RebalanceOptions) ( *Rebalancer, error)
StartRebalance begins a concurrent, cluster-wide rebalancing of all the indexes (and their index partitions) on a cluster of cbgt nodes. StartRebalance utilizes the blance library for calculating and orchestrating partition reassignments and the cbgt/rest/monitor library to watch for progress and errors.
func (*Rebalancer) Log ¶
func (r *Rebalancer) Log(fmt string, v ...interface{})
func (*Rebalancer) PauseNewAssignments ¶
func (r *Rebalancer) PauseNewAssignments() (err error)
PauseNewAssignments pauses any new assignments. Any inflight assignments, however, will continue to completion or error.
func (*Rebalancer) ProgressCh ¶
func (r *Rebalancer) ProgressCh() chan RebalanceProgress
ProgressCh() returns a channel that is updated occassionally when the rebalance has made some progress on one or more partition reassignments, or has reached an error. The channel is closed when the rebalance operation is finished, either naturally, or due to an error, or via a Stop(), and all the rebalance-related resources have been released.
func (*Rebalancer) ResumeNewAssignments ¶
func (r *Rebalancer) ResumeNewAssignments() (err error)
ResumeNewAssignments resumes new assignments.
func (*Rebalancer) Stop ¶
func (r *Rebalancer) Stop()
Stop asynchronously requests a stop to the rebalance operation. Callers can look for the closing of the ProgressCh() to see when the rebalance operation has actually stopped.
func (*Rebalancer) Visit ¶
func (r *Rebalancer) Visit(visitor VisitFunc)
Visit invokes the visitor callback with the current, read-only CurrStates, CurrSeqs and WantSeqs.