sharding

package
v0.0.0-...-14ddd16 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Addr                string
	ShardingAddr        string
	DataPath            string
	Labels              []prophet.Pair
	ProphetName         string
	ProphetAddr         string
	ProphetOptions      []prophet.Option
	FragHBInterval      time.Duration
	StoreHBInterval     time.Duration
	MaxPeerDownDuration time.Duration
	RMLease             time.Duration
	CoreOptions         []core.Option
	InitFragments       int
	Concurrency         int
	OverloadPercentage  uint64
	OverloadPeriod      uint64
	TransSendCB         func(meta.ResourceManager, meta.Notify) error
	TransWorkerCount    int
}

Cfg raftstore configuration

func (*Cfg) Adjust

func (c *Cfg) Adjust()

Adjust adjust

type ContainerAdapter

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

ContainerAdapter adapter for prophet's container and store

func (*ContainerAdapter) Clone

func (c *ContainerAdapter) Clone() prophet.Container

Clone adapter prophet

func (*ContainerAdapter) ID

func (c *ContainerAdapter) ID() uint64

ID adapter prophet

func (*ContainerAdapter) Lables

func (c *ContainerAdapter) Lables() []prophet.Pair

Lables adapter prophet

func (*ContainerAdapter) Marshal

func (c *ContainerAdapter) Marshal() ([]byte, error)

Marshal adapter prophet

func (*ContainerAdapter) State

func (c *ContainerAdapter) State() prophet.State

State adapter prophet

func (*ContainerAdapter) Unmarshal

func (c *ContainerAdapter) Unmarshal(data []byte) error

Unmarshal adapter prophet

type PeerReplicate

type PeerReplicate struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

PeerReplicate is the peer replicate. Every Fragment replicate has a PeerReplicate.

type ProphetAdapter

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

ProphetAdapter adapter prophet

func (*ProphetAdapter) ChangeLeader

func (pa *ProphetAdapter) ChangeLeader(resourceID uint64, newLeader *prophet.Peer)

ChangeLeader prophet adapter

func (*ProphetAdapter) ChangePeer

func (pa *ProphetAdapter) ChangePeer(resourceID uint64, peer *prophet.Peer, changeType prophet.ChangePeerType)

ChangePeer prophet adapter

func (*ProphetAdapter) ContainerHBInterval

func (pa *ProphetAdapter) ContainerHBInterval() time.Duration

ContainerHBInterval fetch container HB interface

func (*ProphetAdapter) FetchContainerHB

func (pa *ProphetAdapter) FetchContainerHB() *prophet.ContainerHeartbeatReq

FetchContainerHB fetch container HB

func (*ProphetAdapter) FetchLeaderResources

func (pa *ProphetAdapter) FetchLeaderResources() []uint64

FetchLeaderResources fetch all local leader resources

func (*ProphetAdapter) FetchResourceHB

func (pa *ProphetAdapter) FetchResourceHB(id uint64) *prophet.ResourceHeartbeatReq

FetchResourceHB fetch resource HB

func (*ProphetAdapter) HBHandler

func (pa *ProphetAdapter) HBHandler() prophet.HeartbeatHandler

HBHandler HB hander

func (*ProphetAdapter) NewContainer

func (pa *ProphetAdapter) NewContainer() prophet.Container

NewContainer return a new container

func (*ProphetAdapter) NewResource

func (pa *ProphetAdapter) NewResource() prophet.Resource

NewResource return a new resource

func (*ProphetAdapter) ResourceHBInterval

func (pa *ProphetAdapter) ResourceHBInterval() time.Duration

ResourceHBInterval fetch resource HB interface

type ResourceAdapter

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

ResourceAdapter adapter for prophet's resource and db

func (*ResourceAdapter) Changed

func (r *ResourceAdapter) Changed(other prophet.Resource) bool

Changed adapter prophet

func (*ResourceAdapter) Clone

func (r *ResourceAdapter) Clone() prophet.Resource

Clone adapter prophet

func (*ResourceAdapter) ID

func (r *ResourceAdapter) ID() uint64

ID adapter prophet

func (*ResourceAdapter) Marshal

func (r *ResourceAdapter) Marshal() ([]byte, error)

Marshal adapter prophet

func (*ResourceAdapter) Peers

func (r *ResourceAdapter) Peers() []*prophet.Peer

Peers adapter prophet

func (*ResourceAdapter) SetPeers

func (r *ResourceAdapter) SetPeers(peers []*prophet.Peer)

SetPeers adapter prophet

func (*ResourceAdapter) Stale

func (r *ResourceAdapter) Stale(other prophet.Resource) bool

Stale adapter prophet

func (*ResourceAdapter) Unmarshal

func (r *ResourceAdapter) Unmarshal(data []byte) error

Unmarshal adapter prophet

type Seata

type Seata struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Seata seata compatibled server

func NewSeata

func NewSeata(cfg Cfg) (*Seata, error)

NewSeata creates a seata compatibled server

func (*Seata) Start

func (f *Seata) Start() error

Start start

func (*Seata) Stop

func (f *Seata) Stop()

Stop stop seata

type Store

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Store is a container of fragment, which maintains a set of fragments, in which the state of the leader is the external service.

func NewStore

func NewStore(cfg Cfg) *Store

NewStore returns store with cfg

func (*Store) BecomeFollower

func (s *Store) BecomeFollower()

BecomeFollower this node is become prophet follower

func (*Store) BecomeLeader

func (s *Store) BecomeLeader()

BecomeLeader this node is become prophet leader

func (*Store) CurrentLeader

func (s *Store) CurrentLeader(fid uint64) (uint64, uint64, error)

CurrentLeader returns current leader

func (*Store) HandleRoutable

func (s *Store) HandleRoutable(ss *session, msg *meta.RouteableMessage)

HandleRoutable handle routable message

func (*Store) Start

func (s *Store) Start()

Start start sharing store

Jump to

Keyboard shortcuts

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