graph

package
v0.0.0-...-060dca9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Unimpl articlestore.Storage = unimpl{}

A None-Object.

Functions

This section is empty.

Types

type CfgConfig

type CfgConfig struct {
	Rings []CfgRing `inn:"@ring" msgpack:"rings"`
}

type CfgRing

type CfgRing struct {
	Ring string `inn:"$ring" msgpack:"n"`

	Type string `inn:"$type" msgpack:"t"`
	Seed uint64 `inn:"$seed" msgpack:"s"`
	Num  int    `inn:"$hops" msgpack:"h"`

	Prio float64 `inn:"$read-priority" msgpack:"p"`

	Shard []string `inn:"@shard"  msgpack:"shards"`
}

type Cluster

type Cluster struct {
	Records map[string]*ClusterNodeRecord

	Master StorageMM
	RingMM StorageMM
	RingSt *RingSet

	Config *CfgConfig

	LocalMeta ClusterMetadata
	// contains filtered or unexported fields
}

func (*Cluster) AddBackend

func (c *Cluster) AddBackend(k1, k2 string, s articlestore.Storage)

func (*Cluster) Create

func (c *Cluster) Create(n *cluster.Node)

func (*Cluster) Delete

func (c *Cluster) Delete(n *cluster.Node)

func (*Cluster) Init

func (c *Cluster) Init()

func (*Cluster) Lookup

func (c *Cluster) Lookup(K1, K2 []byte) articlestore.Storage

func (*Cluster) Metadata

func (c *Cluster) Metadata(limit int) []byte

func (*Cluster) SetConfig

func (c *Cluster) SetConfig(cfg *CfgConfig)

func (*Cluster) StoreReadMessage

func (c *Cluster) StoreReadMessage(id []byte, over, head, body bool) (bufferex.Binary, error)

func (*Cluster) StoreWriteMessage

func (c *Cluster) StoreWriteMessage(id, msg []byte, expire uint64) error

func (*Cluster) Update

func (c *Cluster) Update(n *cluster.Node)

func (*Cluster) ValidateAll

func (c *Cluster) ValidateAll(nn []cluster.Node) bool

type ClusterMetadata

type ClusterMetadata struct {
	Port     int         `msgpack:"port"`
	UserPort int         `msgpack:"userport"`
	Stores   [][2]string `msgpack:"shard"`
}

func (*ClusterMetadata) Decode

func (c *ClusterMetadata) Decode(n *cluster.Node) bool

func (*ClusterMetadata) Encode

func (c *ClusterMetadata) Encode() []byte

type ClusterNodeRecord

type ClusterNodeRecord struct {
	Node cluster.Node
	Info ClusterMetadata
	Cli  *fastrpc.Client
}

func (*ClusterNodeRecord) Insert

func (c *ClusterNodeRecord) Insert(n *cluster.Node) bool

func (*ClusterNodeRecord) Update

func (c *ClusterNodeRecord) Update(n *cluster.Node) bool

type Ring

type Ring struct {
	R hashring.IHashRing
}

func (*Ring) Configure

func (r *Ring) Configure(cfg *CfgRing, st map[string]*Storage)

func (*Ring) StoreReadMessage

func (r *Ring) StoreReadMessage(id []byte, over, head, body bool) (bufferex.Binary, error)

func (*Ring) StoreWriteMessage

func (r *Ring) StoreWriteMessage(id, msg []byte, expire uint64) error

type RingSet

type RingSet struct {
	Rings []Ring
	Trees *avl.Tree
}

func (*RingSet) Configure

func (r *RingSet) Configure(cfg *CfgConfig, stt StorageMM)

func (*RingSet) StoreReadMessage

func (r *RingSet) StoreReadMessage(id []byte, over, head, body bool) (bufferex.Binary, error)

func (*RingSet) StoreWriteMessage

func (r *RingSet) StoreWriteMessage(id, msg []byte, expire uint64) error

func (*RingSet) String

func (r *RingSet) String() string

type Storage

type Storage struct {
	articlestore.Storage
	Class uint
}

func MakeStorage

func MakeStorage() *Storage

func (*Storage) Set

func (s *Storage) Set(obj articlestore.Storage, cls uint)

func (*Storage) Unset

func (s *Storage) Unset()

type StorageMM

type StorageMM map[string]map[string]*Storage

func (StorageMM) RWalk

func (l1 StorageMM) RWalk(k1, k2 string) (p *Storage)

func (StorageMM) Walk

func (l1 StorageMM) Walk(k1, k2 string) (p *Storage)

Jump to

Keyboard shortcuts

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