types

package
v1.31.21 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsistencyLevel

type ConsistencyLevel string

ConsistencyLevel is an enum of all possible consistency level

const (
	ConsistencyLevelOne    ConsistencyLevel = "ONE"
	ConsistencyLevelQuorum ConsistencyLevel = "QUORUM"
	ConsistencyLevelAll    ConsistencyLevel = "ALL"
)

func (ConsistencyLevel) ToInt

func (l ConsistencyLevel) ToInt(n int) int

ToInt returns the minimum number needed to satisfy consistency level l among N

type RepairResponse

type RepairResponse struct {
	ID         string // object id
	Version    int64  // sender's current version of the object
	UpdateTime int64  // sender's current update time
	Err        string
	Deleted    bool
}

type Router

type Router interface {
	GetReadWriteReplicasLocation(collection string, shard string) ([]string, []string, error)
	GetWriteReplicasLocation(collection string, shard string) ([]string, error)
	GetReadReplicasLocation(collection string, shard string) ([]string, error)
	BuildReadRoutingPlan(params RoutingPlanBuildOptions) (RoutingPlan, error)
	BuildWriteRoutingPlan(params RoutingPlanBuildOptions) (RoutingPlan, error)

	NodeHostname(nodeName string) (string, bool)
	AllHostnames() []string
}

type RoutingPlan

type RoutingPlan struct {
	Collection string
	Shard      string
	Replicas   []string

	ConsistencyLevel    ConsistencyLevel
	IntConsistencyLevel int
	ReplicasHostAddrs   []string
	AdditionalHostAddrs []string
}

func (RoutingPlan) LogFields

func (r RoutingPlan) LogFields() logrus.Fields

func (RoutingPlan) ValidateConsistencyLevel

func (r RoutingPlan) ValidateConsistencyLevel() (int, error)

type RoutingPlanBuildOptions

type RoutingPlanBuildOptions struct {
	Collection             string
	Shard                  string
	ConsistencyLevel       ConsistencyLevel
	DirectCandidateReplica string
}

func (RoutingPlanBuildOptions) Validate

func (r RoutingPlanBuildOptions) Validate() error

Jump to

Keyboard shortcuts

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