app

package
v0.0.0-...-9750751 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_RANGES = 256
	CHAN_LEN   = 4
)
View Source
const (
	Idle = iota
	Running
	Finished
)

Variables

View Source
var (
	E9         = uint64(time.Second)
	TEST_PATCH = "__test_patch"
)

Functions

func AddRpcClient

func AddRpcClient(zoneid int, ip string)

func AddScanner

func AddScanner(zoneid, shardid, nodeid int, ip string)

func AddShardInfo

func AddShardInfo(zoneid, shardid, nodeid int, ip string)

func CloseConnect

func CloseConnect()

func ClosePatchDb

func ClosePatchDb()

func Collect

func Collect(file string, startShardid int, stopShardid int,
	skip int, driver bool)

func DoPatch

func DoPatch(namespace string) int

Patch records in target pool

func GenRemoteAddr

func GenRemoteAddr(ip string, zoneid int) string

func GetVersionFromDb

func GetVersionFromDb(key []byte, zoneid int) (data []byte, valLen int,
	msg string)

func GetVersionFromServers

func GetVersionFromServers(key []byte, addr string, numZones int)

func InitPatch

func InitPatch(cfg *config.DbScan)

Called by storageserv

func InitPatchDb

func InitPatchDb(rootPath string, cfg *config.DbScan, readOnly bool)

Called by dbscanserv

func IsCancel

func IsCancel() bool

func IsLocalAddress

func IsLocalAddress(ip string, zoneid int) bool

func IsValidAddr

func IsValidAddr(addr string) bool

func LockSession

func LockSession() (bool, string)

func PingDrivers

func PingDrivers(cmd int, zoneid, startid, stopid int)

func PingServers

func PingServers(cmd int, startid int, stopid int, addr ...string) bool

func PingServersByZone

func PingServersByZone(cmd int, zoneid int, addr string, ns []byte) bool

func RefreshLock

func RefreshLock(addr string)

func RelayDelete

func RelayDelete(ns []byte, key []byte, rec *db.Record) error

Used by storageserv Bump Version Keep same CreationTime Clear payload key is recordId.GetKey()

func ResetScanners

func ResetScanners(startid, stopid int) bool

func SetCancel

func SetCancel()

func SetListenPort

func SetListenPort(port int, b bool)

func ShardRangesOverlap

func ShardRangesOverlap(startid, stopid int) bool

Overlap with the shard range being scanned.

func StartListener

func StartListener() chan CmdRequest

Start listener Return cmdQueue

func UnlockSession

func UnlockSession(addr string)

func UpdatePatch

func UpdatePatch(key, value []byte) error

Types

type ClusterConfig

type ClusterConfig struct {
	CmdConfig
	DB             *db.Config
	DbScanLog      string
	DbWatchEnabled bool
	Sec            sec.Config
	DbScan         config.DbScan
	NumConns       int
}

type ClusterMap

type ClusterMap struct {
	ClusterConfig
	cluster.Cluster
	// contains filtered or unexported fields
}

func InitRemoteMap

func InitRemoteMap(file string) *ClusterMap

func InitScanners

func InitScanners(file string, readOnly bool) *ClusterMap

func (*ClusterMap) GetLocalShardList

func (c *ClusterMap) GetLocalShardList(start int, stop int, skip int) (numZones int,
	numShards int, shardsByNode [][]uint32)

func (*ClusterMap) GetNumZones

func (c *ClusterMap) GetNumZones() int

type CmdConfig

type CmdConfig cmd.Config

type CmdLine

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

func NewCmdLine

func NewCmdLine(cfgFile, cmd string, zoneid int, serverAddr string,
	startid, stopid int, nsNames string, trace bool) *CmdLine

func NewCmdLine2

func NewCmdLine2(cfgFile, cmd string, zoneid int, nsFile string) *CmdLine

func (*CmdLine) HandleCommand

func (c *CmdLine) HandleCommand()

type CmdNamespaceReply

type CmdNamespaceReply struct {
	Cmd          int
	ServerZoneid int
	Locked       bool
	Disabled     bool
	Failed       bool
}

type CmdNamespaceRequest

type CmdNamespaceRequest struct {
	Cmd            int
	ServerZoneid   int
	LockServerAddr string

	NamespaceConfig []byte
}

type CmdReply

type CmdReply struct {
	Cmd          int
	ServerZoneid int

	FirstDbid       int
	LastDbid        int
	NumOpenDbs      int
	ReplicateKeys   int64
	ReplicateErrors int64
	Status          string

	Val    []byte
	ValLen int
	Config config.DbScan
	Error  string
}

func (*CmdReply) DbRange

func (r *CmdReply) DbRange() string

type CmdRequest

type CmdRequest struct {
	Cmd          int
	ServerZoneid int

	IncExpireKeys bool
	ModTimeBegin  int64
	ProxyAddr     string

	RangeidBitlen int
	StartShardid  int
	StopShardid   int

	Key            []byte
	NamespaceNames string
	Trace          bool
}

type CmdUpdatePatch

type CmdUpdatePatch struct {
	Key   []byte
	Value []byte
}

type Collector

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

type KeyPrefix

type KeyPrefix [][]byte

type NSMap

type NSMap map[string]KeyPrefix

type Remote

type Remote int

func (*Remote) GetNext

func (r *Remote) GetNext(req Request, reply *prime.MessageBlock) error

func (*Remote) NamespaceService

func (r *Remote) NamespaceService(req CmdNamespaceRequest,
	reply *CmdNamespaceReply) error

func (*Remote) Ping

func (r *Remote) Ping(req CmdRequest, reply *CmdReply) error

func (*Remote) UpdatePatch

func (r *Remote) UpdatePatch(req CmdUpdatePatch, reply *CmdReply) error

type RemoteMap

type RemoteMap map[string]*RpcClient

map from server ip to rpc client.

type Request

type Request struct {
	Zoneid  int
	Shardid int
	Rangeid int
	prime.KeyList
}

type RpcClient

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

func GetRpcClient

func GetRpcClient(addr string) *RpcClient

func NewRpcClient

func NewRpcClient(port int) *RpcClient

func (*RpcClient) Invoke

func (c *RpcClient) Invoke(methodName string, req interface{},
	reply interface{}) (err error)

func (*RpcClient) Timeout

func (c *RpcClient) Timeout(t int, i int) *RpcClient

type Scanner

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

func GetScanner

func GetScanner(zoneid, shardid int) *Scanner

One scanner per zoneid, shardid.

func (*Scanner) GetNext

func (s *Scanner) GetNext(rangeid int, keyList prime.KeyList) *prime.MessageBlock

func (*Scanner) ScanAndMerge

func (s *Scanner) ScanAndMerge(rangeid int, jm *prime.JoinMap, rs *prime.Result) error

type ScannerMap

type ScannerMap map[int]*Scanner

Map from zoneid, shardid to Scanner

type ShardInfo

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

func GetShardInfo

func GetShardInfo(zoneid, shardid int) (info *ShardInfo, found bool)

type ShardMap

type ShardMap map[int]*ShardInfo

Jump to

Keyboard shortcuts

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