nebula

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = 10 * time.Second

Variables

View Source
var (
	ErrNoAvailableMetadEndpoints = errors.New("metadclient: no available hosts")
	ErrJobStatusFailed           = errors.New("job status failed")
)
View Source
var ErrNoAvailableStoragedEndpoints = errors.New("storagedclient: no available endpoints")

Functions

This section is empty.

Types

type Agent added in v1.4.0

type Agent struct {
	agentclient.Client
}

func NewAgent added in v1.4.0

func NewAgent(agentAddr *nebula.HostAddr) (*Agent, error)

type AgentManager added in v1.4.0

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

func NewAgentManager added in v1.4.0

func NewAgentManager() *AgentManager

func (*AgentManager) Close added in v1.8.0

func (a *AgentManager) Close()

func (*AgentManager) GetAgent added in v1.4.0

func (a *AgentManager) GetAgent(agentAddr *nebula.HostAddr) (*Agent, error)

type Fn added in v1.2.0

type Fn func(req interface{}) (interface{}, error)

type MetaInterface

type MetaInterface interface {
	GetSpace(spaceName []byte) (*meta.SpaceItem, error)
	DropSpace(spaceName []byte) error
	ListSpaces() ([]*meta.IdName, error)
	ListCluster() (*meta.ListClusterInfoResp, error)
	AddHosts(hosts []*nebula.HostAddr) error
	AddHostsIntoZone(hosts []*nebula.HostAddr, zone string) error
	DropHosts(hosts []*nebula.HostAddr) error
	ListHosts(hostType meta.ListHostType) ([]*meta.HostItem, error)
	ListParts(spaceID nebula.GraphSpaceID, partIDs []nebula.PartitionID) ([]*meta.PartItem, error)
	GetSpaceParts() (map[nebula.GraphSpaceID][]*meta.PartItem, error)
	GetSpaceLeaderHosts(space []byte) ([]string, error)
	GetLeaderCount(leaderHost string) (int, error)
	BalanceStatus(jobID int32, spaceID nebula.GraphSpaceID) error
	BalanceLeader(spaceID nebula.GraphSpaceID) error
	BalanceData(spaceID nebula.GraphSpaceID) (int32, error)
	BalanceDataInZone(spaceID nebula.GraphSpaceID) (int32, error)
	RemoveHost(spaceID nebula.GraphSpaceID, hosts []*nebula.HostAddr) (int32, error)
	RemoveHostInZone(spaceID nebula.GraphSpaceID, hosts []*nebula.HostAddr) (int32, error)
	RecoverDataBalanceJob(jobID int32, spaceID nebula.GraphSpaceID) error
	RecoverInZoneBalanceJob(jobID int32, spaceID nebula.GraphSpaceID) error
	RestoreMeta(hosts []*meta.HostPair, files []string) (*meta.RestoreMetaResp, error)
	Disconnect() error
}

func NewMetaClient

func NewMetaClient(hosts []string, options ...Option) (MetaInterface, error)

type Option

type Option func(ops *Options)

func ClientOptions added in v1.5.0

func ClientOptions(nc *v1alpha1.NebulaCluster, opts ...Option) ([]Option, error)

func SetClusterTLS added in v1.5.0

func SetClusterTLS(e bool) Option

func SetIsMeta added in v1.6.2

func SetIsMeta(e bool) Option

func SetIsStorage added in v1.5.0

func SetIsStorage(e bool) Option

func SetMetaTLS added in v1.5.0

func SetMetaTLS(e bool) Option

func SetOptions added in v1.5.0

func SetOptions(options Options) Option

func SetStorageTLS added in v1.6.2

func SetStorageTLS(e bool) Option

func SetTLSConfig added in v1.5.0

func SetTLSConfig(config *tls.Config) Option

func SetTimeout added in v1.5.0

func SetTimeout(duration time.Duration) Option

type Options

type Options struct {
	EnableMetaTLS    bool
	EnableStorageTLS bool
	EnableClusterTLS bool
	IsStorage        bool
	IsMeta           bool
	Timeout          time.Duration
	TLSConfig        *tls.Config
}

type StorageInterface

type StorageInterface interface {
	TransLeader(spaceID nebula.GraphSpaceID, partID nebula.PartitionID, newLeader *nebula.HostAddr) (error, string)
	RemovePart(spaceID nebula.GraphSpaceID, partID nebula.PartitionID) error
	GetLeaderParts() (map[nebula.GraphSpaceID][]nebula.PartitionID, error)
	Disconnect() error
}

func NewStorageClient

func NewStorageClient(endpoints []string, options ...Option) (StorageInterface, error)

Jump to

Keyboard shortcuts

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