etcd

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ApplicationThreadNum goroutine number for Application channel
	ApplicationThreadNum int
	//TaskgroupThreadNum goroutine number for taskgroup channel
	TaskgroupThreadNum int
	//ExportserviceThreadNum goroutine number for exportservice channel
	ExportserviceThreadNum int
	//DeploymentThreadNum goroutine number for deployment channel
	DeploymentThreadNum int
)
View Source
var (
	// SyncDefaultTimeOut default timeout
	SyncDefaultTimeOut = time.Second * 1
)

Functions

func GenerateRandnum

func GenerateRandnum() int

GenerateRandnum just for test

func NewEtcdCluster

func NewEtcdCluster(cfg *types.CmdConfig, st storage.Storage, netservice *service.InnerService) cluster.Cluster

NewEtcdCluster create mesos cluster

Types

type AppWatch

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

AppWatch for app data in zookeeper, app wath is base on namespace. AppWatch will record all namespace path,

func NewAppWatch

func NewAppWatch(cxt context.Context, informer bkbcsv2.ApplicationInformer, reporter cluster.Reporter) *AppWatch

NewAppWatch return a new application watch

func (*AppWatch) AddEvent

func (app *AppWatch) AddEvent(obj interface{})

AddEvent call when data added

func (*AppWatch) DeleteEvent

func (app *AppWatch) DeleteEvent(obj interface{})

DeleteEvent when delete

func (*AppWatch) GetApplicationChannel

func (app *AppWatch) GetApplicationChannel(application *schedulertypes.Application) string

GetApplicationChannel get distribution channel for Application

func (*AppWatch) UpdateEvent

func (app *AppWatch) UpdateEvent(old, cur interface{}, force bool)

UpdateEvent when update

func (*AppWatch) Work

func (app *AppWatch) Work()

Work for sync application by register informer

type ConfigMapInfo

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

ConfigMapInfo wrapper for BCS ConfigMap

type ConfigMapWatch

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

ConfigMapWatch watch for configmap, watch all detail and store to local cache

func NewConfigMapWatch

func NewConfigMapWatch(cxt context.Context, informer bkbcsv2.BcsConfigMapInformer, reporter cluster.Reporter) *ConfigMapWatch

NewConfigMapWatch create watch for BCS ConfigMap

func (*ConfigMapWatch) AddEvent

func (watch *ConfigMapWatch) AddEvent(obj interface{})

AddEvent call when data added

func (*ConfigMapWatch) DeleteEvent

func (watch *ConfigMapWatch) DeleteEvent(obj interface{})

DeleteEvent when delete

func (*ConfigMapWatch) ProcessAllConfigmaps

func (watch *ConfigMapWatch) ProcessAllConfigmaps() error

ProcessAllConfigmaps handle all configmap under all namespace

func (*ConfigMapWatch) UpdateEvent

func (watch *ConfigMapWatch) UpdateEvent(old, cur interface{})

UpdateEvent when update

func (*ConfigMapWatch) Work

func (watch *ConfigMapWatch) Work()

Work to add path and node watch

type DeploymentInfo

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

DeploymentInfo wrapper for BCS Deployment

type DeploymentWatch

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

DeploymentWatch watch all deployment data and store to local cache

func NewDeploymentWatch

func NewDeploymentWatch(cxt context.Context, informer bkbcsv2.DeploymentInformer, reporter cluster.Reporter) *DeploymentWatch

NewDeploymentWatch create deployment watch

func (*DeploymentWatch) AddEvent

func (watch *DeploymentWatch) AddEvent(obj interface{})

AddEvent call when data added

func (*DeploymentWatch) DeleteEvent

func (watch *DeploymentWatch) DeleteEvent(obj interface{})

DeleteEvent when delete

func (*DeploymentWatch) GetDeploymentChannel

func (watch *DeploymentWatch) GetDeploymentChannel(deployment *schedulertypes.Deployment) string

GetDeploymentChannel return random channel by hash algorithm

func (*DeploymentWatch) ProcessAllDeployments

func (watch *DeploymentWatch) ProcessAllDeployments() error

ProcessAllDeployments handle all namespace deployment data

func (*DeploymentWatch) UpdateEvent

func (watch *DeploymentWatch) UpdateEvent(old, cur interface{})

UpdateEvent when update

func (*DeploymentWatch) Work

func (watch *DeploymentWatch) Work()

Work to add path and node watch

type EndpointInfo

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

EndpointInfo wrapper for BCSEndpoint

type EndpointWatch

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

EndpointWatch watch for Endpoint and store all datas to local cache

func NewEndpointWatch

func NewEndpointWatch(cxt context.Context, informer bkbcsv2.BcsEndpointInformer, reporter cluster.Reporter) *EndpointWatch

NewEndpointWatch create endpoint watch

func (*EndpointWatch) AddEvent

func (watch *EndpointWatch) AddEvent(obj interface{})

AddEvent call when data added

func (*EndpointWatch) DeleteEvent

func (watch *EndpointWatch) DeleteEvent(obj interface{})

DeleteEvent when delete

func (*EndpointWatch) ProcessAllEndpoints

func (watch *EndpointWatch) ProcessAllEndpoints() error

ProcessAllEndpoints handle all namespace Endpoint data

func (*EndpointWatch) UpdateEvent

func (watch *EndpointWatch) UpdateEvent(old, cur interface{})

UpdateEvent when update

func (*EndpointWatch) Work

func (watch *EndpointWatch) Work()

Work handle all Endpoint datas periodically

type EtcdCluster

type EtcdCluster struct {
	Status string //curr status
	// contains filtered or unexported fields
}

EtcdCluster cluster implements all cluster interface

func (*EtcdCluster) GetClusterID

func (ms *EtcdCluster) GetClusterID() string

GetClusterID get clusterID

func (*EtcdCluster) GetClusterStatus

func (ms *EtcdCluster) GetClusterStatus() string

GetClusterStatus get synchronization status

func (*EtcdCluster) ReportData

func (ms *EtcdCluster) ReportData(data *types.BcsSyncData) error

ReportData report data to reportHandler, handle all data independently

func (*EtcdCluster) Run

func (ms *EtcdCluster) Run(cxt context.Context)

Run running cluster watch

func (*EtcdCluster) Stop

func (ms *EtcdCluster) Stop()

Stop ask cluster stopped

func (*EtcdCluster) Sync

func (ms *EtcdCluster) Sync(tp string) error

Sync ask cluster to sync data to local cache

type ExportServiceInfo

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

ExportServiceInfo wrapper for ServiceInfo

type ExportServiceWatch

type ExportServiceWatch struct {
	ClusterID string
	// contains filtered or unexported fields
}

ExportServiceWatch watch for taskGroup

func NewExportServiceWatch

func NewExportServiceWatch(cxt context.Context, factory informers.SharedInformerFactory, reporter cluster.Reporter, clusterID string) *ExportServiceWatch

NewExportServiceWatch create export service watch

func (*ExportServiceWatch) AddEvent

func (watch *ExportServiceWatch) AddEvent(obj interface{})

AddEvent call when data added

func (*ExportServiceWatch) DeleteEvent

func (watch *ExportServiceWatch) DeleteEvent(obj interface{})

DeleteEvent when delete

func (*ExportServiceWatch) GetExportserviceChannel

func (watch *ExportServiceWatch) GetExportserviceChannel(exportservice *lbtypes.ExportService) string

GetExportserviceChannel get channel for dispatch

func (*ExportServiceWatch) SyncEpTaskgroupBackend

func (watch *ExportServiceWatch) SyncEpTaskgroupBackend(esInfo *ExportServiceInfo, taskgroup *schedtypes.TaskGroup) error

SyncEpTaskgroupBackend convert taskgroup to exportservice endpoint

func (*ExportServiceWatch) SyncExportServiceBackends

func (watch *ExportServiceWatch) SyncExportServiceBackends(esInfo *ExportServiceInfo) error

SyncExportServiceBackends export service backend synchronization

func (*ExportServiceWatch) UpdateEvent

func (watch *ExportServiceWatch) UpdateEvent(obj interface{})

UpdateEvent when update

type NSControlInfo

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

NSControlInfo store all app info under one namespace

type NetServiceWatcher

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

NetServiceWatcher watchs resources in netservice, and sync to storage.

func NewNetServiceWatcher

func NewNetServiceWatcher(clusterID string, reporter cluster.Reporter, netservice *service.InnerService) *NetServiceWatcher

NewNetServiceWatcher return a new netservice watcher.

func (*NetServiceWatcher) Run

func (w *NetServiceWatcher) Run(stopCh <-chan struct{})

Run starts the netservice watcher.

func (*NetServiceWatcher) SyncIPResource

func (w *NetServiceWatcher) SyncIPResource()

SyncIPResource syncs target ip resources to storages.

func (*NetServiceWatcher) SyncIPResourceDetail

func (w *NetServiceWatcher) SyncIPResourceDetail()

SyncIPResourceDetail sync target ip resource detail to storages.

type SecretInfo

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

SecretInfo wrapper for BCSSecret

type SecretWatch

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

SecretWatch watch all secret data and store in local cache

func NewSecretWatch

func NewSecretWatch(cxt context.Context, informer bkbcsv2.BcsSecretInformer, reporter cluster.Reporter) *SecretWatch

NewSecretWatch create SecretWatch for data synchronization

func (*SecretWatch) AddEvent

func (watch *SecretWatch) AddEvent(obj interface{})

AddEvent call when data added

func (*SecretWatch) DeleteEvent

func (watch *SecretWatch) DeleteEvent(obj interface{})

DeleteEvent when delete

func (*SecretWatch) ProcessAllSecrets

func (watch *SecretWatch) ProcessAllSecrets() error

ProcessAllSecrets handle all namespaces data

func (*SecretWatch) UpdateEvent

func (watch *SecretWatch) UpdateEvent(old, cur interface{})

UpdateEvent when update

func (*SecretWatch) Work

func (watch *SecretWatch) Work()

Work list all namespace secret periodically

type ServiceInfo

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

ServiceInfo wrapper for BCSService

type ServiceWatch

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

ServiceWatch watch all event for Service and store in local cache

func NewServiceWatch

func NewServiceWatch(cxt context.Context, informer bkbcsv2.BcsServiceInformer, reporter cluster.Reporter) *ServiceWatch

NewServiceWatch create watch for Service

func (*ServiceWatch) AddEvent

func (watch *ServiceWatch) AddEvent(obj interface{})

AddEvent call when data added

func (*ServiceWatch) DeleteEvent

func (watch *ServiceWatch) DeleteEvent(obj interface{})

DeleteEvent when delete

func (*ServiceWatch) ProcessAllServices

func (watch *ServiceWatch) ProcessAllServices() error

ProcessAllServices handle all namespace service

func (*ServiceWatch) UpdateEvent

func (watch *ServiceWatch) UpdateEvent(old, cur interface{})

UpdateEvent when update

func (*ServiceWatch) Work

func (watch *ServiceWatch) Work()

Work list all Service data periodically

type TaskControlInfo

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

TaskControlInfo store all task info under one namespace

type TaskGroupWatch

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

TaskGroupWatch watch for taskGroup

func NewTaskGroupWatch

func NewTaskGroupWatch(cxt context.Context, informer bkbcsv2.TaskGroupInformer, reporter cluster.Reporter) *TaskGroupWatch

NewTaskGroupWatch create default taskgroup watch

func (*TaskGroupWatch) AddEvent

func (task *TaskGroupWatch) AddEvent(obj interface{})

AddEvent call when data added

func (*TaskGroupWatch) DeleteEvent

func (task *TaskGroupWatch) DeleteEvent(obj interface{})

DeleteEvent when delete

func (*TaskGroupWatch) GetTaskGroupChannel

func (task *TaskGroupWatch) GetTaskGroupChannel(taskGroup *schedulertypes.TaskGroup) string

GetTaskGroupChannel get taskgroup dispatch channel

func (*TaskGroupWatch) GetTaskGroupChannelV2

func (task *TaskGroupWatch) GetTaskGroupChannelV2(taskGroup *schedulertypes.TaskGroup) string

GetTaskGroupChannelV2 get taskgroup dispatch channel

func (*TaskGroupWatch) UpdateEvent

func (task *TaskGroupWatch) UpdateEvent(old, cur interface{}, force bool)

UpdateEvent when update

func (*TaskGroupWatch) Work

func (task *TaskGroupWatch) Work()

Work main work init for taskgroup

Jump to

Keyboard shortcuts

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