Documentation ¶
Index ¶
- Constants
- Variables
- func CreateZkHost(ctx *thriftext.ThreadCtx, client curator.CuratorFramework, ...) (iface.Host, error)
- func MurmurHash64(data []byte, seed int) (h int64)
- type Murmur64Partitioner
- type ZkCoordinator
- func (p *ZkCoordinator) AddDomain(ctx *thriftext.ThreadCtx, domainName string, numParts int32, ...) (iface.Domain, error)
- func (p *ZkCoordinator) AddDomainGroup(ctx *thriftext.ThreadCtx, name string) (iface.DomainGroup, error)
- func (p *ZkCoordinator) AddRingGroup(ctx *thriftext.ThreadCtx, name string) (iface.RingGroup, error)
- func (p *ZkCoordinator) GetDomain(domain string) iface.Domain
- func (p *ZkCoordinator) GetDomainById(ctx *thriftext.ThreadCtx, domainId iface.DomainID) (iface.Domain, error)
- func (p *ZkCoordinator) GetDomainGroup(name string) iface.DomainGroup
- func (p *ZkCoordinator) GetRingGroup(name string) iface.RingGroup
- func (p *ZkCoordinator) GetRingGroups() []iface.RingGroup
- type ZkDomain
- type ZkDomainGroup
- func (p *ZkDomainGroup) GetDomainVersion(domain iface.DomainID) *iface.DomainAndVersion
- func (p *ZkDomainGroup) GetDomainVersions(ctx *thriftext.ThreadCtx) []*iface.DomainAndVersion
- func (p *ZkDomainGroup) GetName() string
- func (p *ZkDomainGroup) SetDomainVersions(ctx *thriftext.ThreadCtx, versions map[iface.DomainID]iface.VersionID) error
- type ZkHost
- func (p *ZkHost) AddDomain(ctx *thriftext.ThreadCtx, domain iface.Domain) (iface.HostDomain, error)
- func (p *ZkHost) AddStateChangeListener(listener thriftext.DataListener)
- func (p *ZkHost) Delete()
- func (p *ZkHost) GetAddress() *iface.PartitionServerAddress
- func (p *ZkHost) GetAssignedDomains(ctx *thriftext.ThreadCtx) []iface.HostDomain
- func (p *ZkHost) GetEnvironmentFlags(ctx *thriftext.ThreadCtx) map[string]string
- func (p *ZkHost) GetHostDomain(ctx *thriftext.ThreadCtx, domainId iface.DomainID) iface.HostDomain
- func (p *ZkHost) GetID() string
- func (p *ZkHost) GetMetadata(ctx *thriftext.ThreadCtx) *hank.HostMetadata
- func (p *ZkHost) GetPath() string
- func (p *ZkHost) GetState() iface.HostState
- func (p *ZkHost) SetEnvironmentFlags(ctx *thriftext.ThreadCtx, flags map[string]string) error
- func (p *ZkHost) SetState(ctx *thriftext.ThreadCtx, state iface.HostState) error
- type ZkHostDomain
- type ZkHostDomainPartition
- func (p *ZkHostDomainPartition) GetCurrentDomainVersion() iface.VersionID
- func (p *ZkHostDomainPartition) GetPartitionNumber() iface.PartitionID
- func (p *ZkHostDomainPartition) IsDeletable() bool
- func (p *ZkHostDomainPartition) SetCurrentDomainVersion(ctx *thriftext.ThreadCtx, version iface.VersionID) error
- type ZkRing
- func (p *ZkRing) AddHost(ctx *thriftext.ThreadCtx, hostName string, port int, hostFlags []string) (iface.Host, error)
- func (p *ZkRing) GetHosts(ctx *thriftext.ThreadCtx) []iface.Host
- func (p *ZkRing) GetNum() iface.RingID
- func (p *ZkRing) RemoveHost(ctx *thriftext.ThreadCtx, hostName string, port int) bool
- type ZkRingGroup
- func (p *ZkRingGroup) AddListener(listener thriftext.DataChangeNotifier)
- func (p *ZkRingGroup) AddRing(ctx *thriftext.ThreadCtx, ringNum iface.RingID) (iface.Ring, error)
- func (p *ZkRingGroup) DeregisterClient(ctx *thriftext.ThreadCtx, id string) error
- func (p *ZkRingGroup) GetClients() []*hank.ClientMetadata
- func (p *ZkRingGroup) GetName() string
- func (p *ZkRingGroup) GetRing(ringNum iface.RingID) iface.Ring
- func (p *ZkRingGroup) GetRings() []iface.Ring
- func (p *ZkRingGroup) RegisterClient(ctx *thriftext.ThreadCtx, metadata *hank.ClientMetadata) (id string, err error)
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 MurmurHash64 ¶
this is probably * wrong * in a technical sense, but it matches Hank's Java implementation (hopefully)
Types ¶
type Murmur64Partitioner ¶
type Murmur64Partitioner struct{}
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) AddDomainGroup ¶
func (p *ZkCoordinator) AddDomainGroup(ctx *thriftext.ThreadCtx, name string) (iface.DomainGroup, error)
func (*ZkCoordinator) AddRingGroup ¶
func (*ZkCoordinator) GetDomainById ¶
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) GetNumParts ¶
func (*ZkDomain) GetPartitioner ¶
func (p *ZkDomain) GetPartitioner() iface.Partitioner
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 ¶
type ZkHost ¶
type ZkHost struct {
// contains filtered or unexported fields
}
func (*ZkHost) AddStateChangeListener ¶
func (p *ZkHost) AddStateChangeListener(listener thriftext.DataListener)
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 (*ZkHost) GetHostDomain ¶
func (*ZkHost) GetMetadata ¶
func (p *ZkHost) GetMetadata(ctx *thriftext.ThreadCtx) *hank.HostMetadata
func (*ZkHost) SetEnvironmentFlags ¶
type ZkHostDomain ¶
type ZkHostDomain struct {
// contains filtered or unexported fields
}
func (*ZkHostDomain) AddPartition ¶
func (p *ZkHostDomain) AddPartition(ctx *thriftext.ThreadCtx, partNum iface.PartitionID) iface.HostDomainPartition
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 ¶
type ZkRing ¶
type ZkRing struct {
// contains filtered or unexported fields
}
type ZkRingGroup ¶
type ZkRingGroup struct {
// contains filtered or unexported fields
}
func (*ZkRingGroup) AddListener ¶
func (p *ZkRingGroup) AddListener(listener thriftext.DataChangeNotifier)
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) GetRings ¶
func (p *ZkRingGroup) GetRings() []iface.Ring
func (*ZkRingGroup) RegisterClient ¶
func (p *ZkRingGroup) RegisterClient(ctx *thriftext.ThreadCtx, metadata *hank.ClientMetadata) (id string, err error)
Click to show internal directories.
Click to hide internal directories.