iface

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: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsClientMetadata

func AsClientMetadata(val interface{}) *hank.ClientMetadata

func AsDomainGroupMetadata

func AsDomainGroupMetadata(val interface{}) *hank.DomainGroupMetadata

func AsDomainMetadata

func AsDomainMetadata(val interface{}) *hank.DomainMetadata

func AsHostAssignmentsMetadata

func AsHostAssignmentsMetadata(val interface{}) *hank.HostAssignmentsMetadata

func AsHostMetadata

func AsHostMetadata(val interface{}) *hank.HostMetadata

func NewDomainGroupMetadata

func NewDomainGroupMetadata() interface{}

func NewDomainMetadata

func NewDomainMetadata() interface{}

func NewHostAssignmentMetadata

func NewHostAssignmentMetadata() interface{}

func NewHostMetadata

func NewHostMetadata() interface{}

Types

type Coordinator

type Coordinator interface {
	GetRingGroup(ringGroupName string) RingGroup

	AddDomainGroup(ctx *thriftext.ThreadCtx, name string) (DomainGroup, error)

	GetDomainGroup(domainGroupName string) DomainGroup

	GetRingGroups() []RingGroup

	GetDomainById(ctx *thriftext.ThreadCtx, domainId DomainID) (Domain, error)

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

	GetDomain(domain string) Domain
}

type Domain

type Domain interface {
	GetName() string

	GetId() DomainID

	GetPartitioner() Partitioner

	GetNumParts() int32

	GetPath() string
}

func AsDomain

func AsDomain(val interface{}) Domain

type DomainAndVersion

type DomainAndVersion struct {
	DomainID  DomainID
	VersionID VersionID
}

type DomainGroup

type DomainGroup interface {
	GetName() string

	SetDomainVersions(ctx *thriftext.ThreadCtx, flags map[DomainID]VersionID) error

	GetDomainVersions(ctx *thriftext.ThreadCtx) []*DomainAndVersion

	GetDomainVersion(domainID DomainID) *DomainAndVersion
}

func AsDomainGroup

func AsDomainGroup(val interface{}) DomainGroup

type DomainID

type DomainID int32

type Host

type Host interface {
	GetMetadata(ctx *thriftext.ThreadCtx) *hank.HostMetadata

	GetAssignedDomains(ctx *thriftext.ThreadCtx) []HostDomain

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

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

	AddDomain(ctx *thriftext.ThreadCtx, domain Domain) (HostDomain, error)

	GetAddress() *PartitionServerAddress

	GetHostDomain(ctx *thriftext.ThreadCtx, domainId DomainID) HostDomain

	AddStateChangeListener(listener thriftext.DataListener)

	SetState(ctx *thriftext.ThreadCtx, state HostState) error

	GetState() HostState

	GetID() string

	GetPath() string

	Delete()
}

type HostDomain

type HostDomain interface {
	GetDomain(ctx *thriftext.ThreadCtx, coordinator Coordinator) (Domain, error)

	AddPartition(ctx *thriftext.ThreadCtx, partNum PartitionID) HostDomainPartition

	GetPartitions() []HostDomainPartition
}

type HostDomainPartition

type HostDomainPartition interface {
	GetPartitionNumber() PartitionID

	GetCurrentDomainVersion() VersionID

	SetCurrentDomainVersion(ctx *thriftext.ThreadCtx, version VersionID) error

	IsDeletable() bool
}

func AsHostDomainPartition

func AsHostDomainPartition(val interface{}) HostDomainPartition

type HostState

type HostState string
const (
	HOST_IDLE     HostState = "IDLE"
	HOST_SERVING  HostState = "SERVING"
	HOST_UPDATING HostState = "UPDATING"
	HOST_OFFLINE  HostState = "OFFLINE"
)

type PartitionID

type PartitionID int32

type PartitionServerAddress

type PartitionServerAddress struct {
	HostName   string
	PortNumber int32
}

func (*PartitionServerAddress) Print

func (p *PartitionServerAddress) Print() string

type Partitioner

type Partitioner interface {
	Partition(key []byte, numPartitions int32) int32
}

type Ring

type Ring interface {
	AddHost(ctx *thriftext.ThreadCtx, hostName string, port int, hostFlags []string) (Host, error)

	GetHosts(ctx *thriftext.ThreadCtx) []Host

	GetNum() RingID

	RemoveHost(ctx *thriftext.ThreadCtx, hostName string, port int) bool
}

func AsRing

func AsRing(val interface{}) Ring

type RingGroup

type RingGroup interface {
	GetName() string

	GetRings() []Ring

	AddRing(ctx *thriftext.ThreadCtx, ringNum RingID) (Ring, error)

	GetRing(ringNum RingID) Ring

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

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

	GetClients() []*hank.ClientMetadata

	AddListener(listener thriftext.DataChangeNotifier)
}

func AsRingGroup

func AsRingGroup(val interface{}) RingGroup

type RingID

type RingID int32

type VersionID

type VersionID int32
const NO_VERSION VersionID = -1

Jump to

Keyboard shortcuts

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