kvrocks

package
v0.9.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterNotInitErr     = "CLUSTERDOWN The cluster is not initialized"
	ClusterAlreadyMigrate = "Can't migrate slot which has been migrated"
	ClusterSlotInvalid    = "Can't migrate slot which doesn't belong to me"
	ClusterVersionInvalid = "Invalid cluster version"
	ClusterInvalidVersion = "Invalid version of cluster"
)
View Source
const (
	KVRocksPort   = 6379
	SentinelPort  = 26379
	SuperUser     = "superuser"
	RoleMaster    = "master"
	RoleSlaver    = "slave"
	Quorum        = 2
	HashSlotCount = 16384
)
View Source
const ErrPassword = "ERR invalid password"

Variables

This section is empty.

Functions

func SlotsToInt

func SlotsToInt(slots []string) []int

func SlotsToString

func SlotsToString(slots []int) []string

Types

type Client

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

func NewKVRocksClient

func NewKVRocksClient(logger logr.Logger) *Client

func (*Client) ChangeMyselfToMaster

func (s *Client) ChangeMyselfToMaster(ip, password string) error

func (*Client) ChangePassword

func (s *Client) ChangePassword(ip, password, newPassword string) error

func (*Client) ClusterNodeInfo

func (s *Client) ClusterNodeInfo(ip, password string) (*Node, error)

func (*Client) ClusterVersion

func (s *Client) ClusterVersion(ip, password string) (int, error)

func (*Client) CreateMonitor

func (s *Client) CreateMonitor(sentinelIP, password, master, ip, kvPass string) error

func (*Client) GetConfig

func (s *Client) GetConfig(ip, password, key string) (*string, error)

func (*Client) GetMaster

func (s *Client) GetMaster(ip, password string) (string, error)

func (*Client) GetMasterFromSentinel

func (s *Client) GetMasterFromSentinel(sentinelIP, sentinelPassword, master string) (string, error)

func (*Client) GetOffset

func (s *Client) GetOffset(ip, password string) (int, error)

func (*Client) MoveSlots

func (s *Client) MoveSlots(ip, password string, slot int, dstNodeId string) bool

func (*Client) NodeInfo

func (s *Client) NodeInfo(ip, password string) (node Node, err error)

func (*Client) Ping

func (s *Client) Ping(ip, password string) bool

func (*Client) RemoveMonitor

func (s *Client) RemoveMonitor(sentinelIP, password, master string) error

func (*Client) ResetMonitor

func (s *Client) ResetMonitor(sentinelIP, sentinelPassword, master, password string) error

func (*Client) ResetSlot

func (s *Client) ResetSlot(ip, password string, slot, version int, dstNodeId string) error

func (*Client) SetClusterID

func (s *Client) SetClusterID(ip, password, nodeID string) error

func (*Client) SetConfig

func (s *Client) SetConfig(ip, password string, key, value string) error

func (*Client) SetTopoMsg

func (s *Client) SetTopoMsg(ip, password, topoMsg string, version int) error

func (*Client) SlaveOf

func (s *Client) SlaveOf(slaveIP, masterIP, password string) error

func (*Client) SubOdownMsg

func (s *Client) SubOdownMsg(ip, password string) (*redis.PubSub, func())

type ImportMsg

type ImportMsg struct {
	SrcNodeId string
	Slots     []int
}

type MigrateMsg

type MigrateMsg struct {
	DstNodeID string
	Slots     []int
}

type Node

type Node struct {
	IP       string
	Role     string
	PodIndex int
	Slots    []int
	NodeId   string
	Master   string
	Expected int
	Failover bool
	Migrate  []MigrateMsg
	Import   []ImportMsg
}

func (*Node) InsertSlot

func (node *Node) InsertSlot(value int)

Jump to

Keyboard shortcuts

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