zk_coordinator

package
v0.0.0-...-78fbe0a Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 13 Imported by: 6

Documentation

Index

Constants

View Source
const ASSIGNMENTS_PATH string = "a"
View Source
const CLIENT_NODE string = "c"
View Source
const CLIENT_ROOT string = "c"
View Source
const HOSTS_PATH_SEGMENT string = "hosts"
View Source
const KEY_DOMAIN_ID_COUNTER string = ".domain_id_counter"
View Source
const M = int64(-4132994306676758123)
View Source
const SEED = 645568
View Source
const STATE_PATH string = "s"

Variables

View Source
var RING_REGEX = regexp.MustCompile("ring-([0-9]+)")

Functions

func CreateZkHost

func CreateZkHost(ctx *thriftext.ThreadCtx, client curator.CuratorFramework, listener thriftext.DataChangeNotifier, basePath string, hostName string, port int, flags []string) (iface.Host, error)

func MurmurHash64

func MurmurHash64(data []byte, seed int) (h int64)

this is probably * wrong * in a technical sense, but it matches Hank's Java implementation (hopefully)

Types

type Murmur64Partitioner

type Murmur64Partitioner struct{}

func (*Murmur64Partitioner) Partition

func (p *Murmur64Partitioner) Partition(key []byte, numPartitions int32) int32

type ZkCoordinator

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

func InitializeZkCoordinator

func InitializeZkCoordinator(client curator.CuratorFramework,
	domainsRoot string,
	ringGroupsRoot string,
	domainGroupsRoot string) (*ZkCoordinator, error)

func NewZkCoordinator

func NewZkCoordinator(client curator.CuratorFramework,
	domainsRoot string,
	ringGroupsRoot string,
	domainGroupsRoot string) (*ZkCoordinator, error)

func (*ZkCoordinator) AddDomain

func (p *ZkCoordinator) AddDomain(ctx *thriftext.ThreadCtx,
	domainName string,
	numParts int32,
	storageEngineFactoryName string,
	storageEngineOptions string,
	partitionerName string,
	requiredHostFlags []string) (iface.Domain, error)

func (*ZkCoordinator) AddDomainGroup

func (p *ZkCoordinator) AddDomainGroup(ctx *thriftext.ThreadCtx, name string) (iface.DomainGroup, error)

func (*ZkCoordinator) AddRingGroup

func (p *ZkCoordinator) AddRingGroup(ctx *thriftext.ThreadCtx, name string) (iface.RingGroup, error)

func (*ZkCoordinator) GetDomain

func (p *ZkCoordinator) GetDomain(domain string) iface.Domain

func (*ZkCoordinator) GetDomainById

func (p *ZkCoordinator) GetDomainById(ctx *thriftext.ThreadCtx, domainId iface.DomainID) (iface.Domain, error)

func (*ZkCoordinator) GetDomainGroup

func (p *ZkCoordinator) GetDomainGroup(name string) iface.DomainGroup

func (*ZkCoordinator) GetRingGroup

func (p *ZkCoordinator) GetRingGroup(name string) iface.RingGroup

func (*ZkCoordinator) GetRingGroups

func (p *ZkCoordinator) GetRingGroups() []iface.RingGroup

type ZkDomain

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

func (*ZkDomain) GetId

func (p *ZkDomain) GetId() iface.DomainID

func (*ZkDomain) GetName

func (p *ZkDomain) GetName() string

func (*ZkDomain) GetNumParts

func (p *ZkDomain) GetNumParts() int32

func (*ZkDomain) GetPartitioner

func (p *ZkDomain) GetPartitioner() iface.Partitioner

func (*ZkDomain) GetPath

func (p *ZkDomain) GetPath() string

type ZkDomainGroup

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

func (*ZkDomainGroup) GetDomainVersion

func (p *ZkDomainGroup) GetDomainVersion(domain iface.DomainID) *iface.DomainAndVersion

func (*ZkDomainGroup) GetDomainVersions

func (p *ZkDomainGroup) GetDomainVersions(ctx *thriftext.ThreadCtx) []*iface.DomainAndVersion

func (*ZkDomainGroup) GetName

func (p *ZkDomainGroup) GetName() string

func (*ZkDomainGroup) SetDomainVersions

func (p *ZkDomainGroup) SetDomainVersions(ctx *thriftext.ThreadCtx, versions map[iface.DomainID]iface.VersionID) error

type ZkHost

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

func (*ZkHost) AddDomain

func (p *ZkHost) AddDomain(ctx *thriftext.ThreadCtx, domain iface.Domain) (iface.HostDomain, error)

func (*ZkHost) AddStateChangeListener

func (p *ZkHost) AddStateChangeListener(listener thriftext.DataListener)

func (*ZkHost) Delete

func (p *ZkHost) Delete()

func (*ZkHost) GetAddress

func (p *ZkHost) GetAddress() *iface.PartitionServerAddress

func (*ZkHost) GetAssignedDomains

func (p *ZkHost) GetAssignedDomains(ctx *thriftext.ThreadCtx) []iface.HostDomain

func (*ZkHost) GetEnvironmentFlags

func (p *ZkHost) GetEnvironmentFlags(ctx *thriftext.ThreadCtx) map[string]string

func (*ZkHost) GetHostDomain

func (p *ZkHost) GetHostDomain(ctx *thriftext.ThreadCtx, domainId iface.DomainID) iface.HostDomain

func (*ZkHost) GetID

func (p *ZkHost) GetID() string

func (*ZkHost) GetMetadata

func (p *ZkHost) GetMetadata(ctx *thriftext.ThreadCtx) *hank.HostMetadata

func (*ZkHost) GetPath

func (p *ZkHost) GetPath() string

func (*ZkHost) GetState

func (p *ZkHost) GetState() iface.HostState

func (*ZkHost) SetEnvironmentFlags

func (p *ZkHost) SetEnvironmentFlags(ctx *thriftext.ThreadCtx, flags map[string]string) error

func (*ZkHost) SetState

func (p *ZkHost) SetState(ctx *thriftext.ThreadCtx, state iface.HostState) error

type ZkHostDomain

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

func (*ZkHostDomain) AddPartition

func (*ZkHostDomain) GetDomain

func (p *ZkHostDomain) GetDomain(ctx *thriftext.ThreadCtx, coordinator iface.Coordinator) (iface.Domain, error)

func (*ZkHostDomain) GetPartitions

func (p *ZkHostDomain) GetPartitions() []iface.HostDomainPartition

type ZkHostDomainPartition

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

func (*ZkHostDomainPartition) GetCurrentDomainVersion

func (p *ZkHostDomainPartition) GetCurrentDomainVersion() iface.VersionID

func (*ZkHostDomainPartition) GetPartitionNumber

func (p *ZkHostDomainPartition) GetPartitionNumber() iface.PartitionID

func (*ZkHostDomainPartition) IsDeletable

func (p *ZkHostDomainPartition) IsDeletable() bool

func (*ZkHostDomainPartition) SetCurrentDomainVersion

func (p *ZkHostDomainPartition) SetCurrentDomainVersion(ctx *thriftext.ThreadCtx, version iface.VersionID) error

type ZkRing

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

func (*ZkRing) AddHost

func (p *ZkRing) AddHost(ctx *thriftext.ThreadCtx, hostName string, port int, hostFlags []string) (iface.Host, error)

func (*ZkRing) GetHosts

func (p *ZkRing) GetHosts(ctx *thriftext.ThreadCtx) []iface.Host

func (*ZkRing) GetNum

func (p *ZkRing) GetNum() iface.RingID

func (*ZkRing) RemoveHost

func (p *ZkRing) RemoveHost(ctx *thriftext.ThreadCtx, hostName string, port int) bool

type ZkRingGroup

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

func (*ZkRingGroup) AddListener

func (p *ZkRingGroup) AddListener(listener thriftext.DataChangeNotifier)

func (*ZkRingGroup) AddRing

func (p *ZkRingGroup) AddRing(ctx *thriftext.ThreadCtx, ringNum iface.RingID) (iface.Ring, error)

func (*ZkRingGroup) DeregisterClient

func (p *ZkRingGroup) DeregisterClient(ctx *thriftext.ThreadCtx, id string) error

func (*ZkRingGroup) GetClients

func (p *ZkRingGroup) GetClients() []*hank.ClientMetadata

func (*ZkRingGroup) GetName

func (p *ZkRingGroup) GetName() string

func (*ZkRingGroup) GetRing

func (p *ZkRingGroup) GetRing(ringNum iface.RingID) iface.Ring

func (*ZkRingGroup) GetRings

func (p *ZkRingGroup) GetRings() []iface.Ring

func (*ZkRingGroup) RegisterClient

func (p *ZkRingGroup) RegisterClient(ctx *thriftext.ThreadCtx, metadata *hank.ClientMetadata) (id string, err error)

Jump to

Keyboard shortcuts

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