Documentation ¶
Index ¶
- func IsUnavailableError(err error) bool
- type Cluster
- func (c *Cluster) Close()
- func (c *Cluster) Freeze(nodeIdx int, freeze bool)
- func (c *Cluster) HTTPPort(nodeIdx int) int
- func (c *Cluster) RPCAddr(nodeIdx int) string
- func (c *Cluster) RPCPort(nodeIdx int) int
- func (c *Cluster) RandNode(f func(int) int) int
- func (c *Cluster) Split(nodeIdx int, splitKey roachpb.Key) error
- func (c *Cluster) Start(db string, numWorkers int, env, allNodeArgs []string, ...)
- func (c *Cluster) TransferLease(nodeIdx int, r *rand.Rand, key roachpb.Key) (bool, error)
- func (c *Cluster) UpdateZoneConfig(rangeMinBytes, rangeMaxBytes int64)
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsUnavailableError ¶
IsUnavailableError returns true iff the error corresponds to a GRPC connection unavailable error.
Types ¶
type Cluster ¶
type Cluster struct { Nodes []*Node Clients []*client.DB Status []serverpb.StatusClient DB []*gosql.DB // contains filtered or unexported fields }
Cluster holds the state for a local cluster, providing methods for common operations, access to the underlying nodes and per-node KV and SQL clients.
func (*Cluster) Close ¶
func (c *Cluster) Close()
Close stops the cluster, killing all of the nodes.
func (*Cluster) Freeze ¶
Freeze freezes (or thaws) the cluster. The freeze request is sent to the specified node.
func (*Cluster) Start ¶
func (c *Cluster) Start( db string, numWorkers int, env, allNodeArgs []string, perNodeArgs map[int][]string, )
Start starts a cluster. The numWorkers parameter controls the SQL connection settings to avoid unnecessary connection creation. The allNodeArgs parameter can be used to pass extra arguments to every node. The perNodeArgs parameter can be used to pass extra arguments to an individual node. If not nil, its size must equal the number of nodes.
func (*Cluster) TransferLease ¶
TransferLease transfers the lease for the range containing key to a random alive node in the range.
func (*Cluster) UpdateZoneConfig ¶
UpdateZoneConfig updates the default zone config for the cluster.