shard

package
v0.0.0-...-a56bf6c Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: PostgreSQL Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShardIDs

func ShardIDs(shards []Shard) []uint

ShardIDs returns a slice of shard IDs extracted from the given list of shards. It takes a list of shards as input and returns a slice of shard IDs.

Parameters:

  • shards: A list of shards to extract the IDs from.

Returns:

  • []uint: A slice of shard IDs.

Types

type CoordShardinfo

type CoordShardinfo interface {
	Shardinfo
	Router() string
}

type ParameterSet

type ParameterSet map[string]string

func (ParameterSet) Save

func (ps ParameterSet) Save(status ParameterStatus) bool

Save saves the given ParameterStatus to the ParameterSet. It returns true if the status was successfully saved, and false if the status already exists in the set.

Parameters:

  • status: The ParameterStatus to save.

Returns:

  • bool: A boolean indicating whether the status was successfully saved.

TODO : unit tests

type ParameterStatus

type ParameterStatus struct {
	Name  string
	Value string
}

type PreparedStatementsMgrDescriptor

type PreparedStatementsMgrDescriptor struct {
	Name     string
	Query    string
	Hash     uint64
	ServerId uint
}

type Shard

type Shard interface {
	txstatus.TxStatusMgr
	prepstatement.PreparedStatementHolder
	Shardinfo

	Name() string
	SHKey() kr.ShardKey
	Send(query pgproto3.FrontendMessage) error
	Receive() (pgproto3.BackendMessage, error)
	Cleanup(rule *config.FrontendRule) error
	Instance() conn.DBInstance
	Cancel() error
	Params() ParameterSet
	Close() error
}

type ShardIterator

type ShardIterator interface {
	ForEach(cb func(sh Shardinfo) error) error
}

type Shardinfo

type Shardinfo interface {
	ID() uint
	ShardKeyName() string
	InstanceHostname() string
	Pid() uint32
	Usr() string
	DB() string
	Sync() int64
	DataPending() bool

	RequestData()

	TxServed() int64
	TxStatus() txstatus.TXStatus

	ListPreparedStatements() []PreparedStatementsMgrDescriptor
}

Jump to

Keyboard shortcuts

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