mesos

package
v1.29.0-alpha.152 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package mesos xxx

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 NewMesosCluster

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

NewMesosCluster 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, client ZkClient, 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) IsExist

func (app *AppWatch) IsExist(data interface{}) bool

IsExist check data exist in local dataCache

func (*AppWatch) UpdateEvent

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

UpdateEvent when update

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, client ZkClient, reporter cluster.Reporter,
	watchPath string) *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, client ZkClient, reporter cluster.Reporter,
	watchPath string) *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 get channel by random 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, client ZkClient, reporter cluster.Reporter,
	watchPath string) *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 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, client ZkClient, reporter cluster.Reporter, clusterID,
	watchPath 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 MesosCluster

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

MesosCluster cluster implements all cluster interface

func (*MesosCluster) GetClusterID

func (ms *MesosCluster) GetClusterID() string

GetClusterID get mesos clusterID

func (*MesosCluster) GetClusterStatus

func (ms *MesosCluster) GetClusterStatus() string

GetClusterStatus get synchronization status

func (*MesosCluster) ProcessAppPathes

func (ms *MesosCluster) ProcessAppPathes() error

ProcessAppPathes handle all Application datas

func (*MesosCluster) ReportData

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

ReportData report data to reportHandler, handle all data independently

func (*MesosCluster) Run

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

Run running cluster watch

func (*MesosCluster) Stop

func (ms *MesosCluster) Stop()

Stop ask cluster stopped

func (*MesosCluster) Sync

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

Sync ask cluster to sync data to local cache

type NSControlInfo

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

NSControlInfo store all app info under one namespace

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, client ZkClient, reporter cluster.Reporter, watchPath string) *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, client ZkClient, reporter cluster.Reporter, watchPath string) *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 app 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, client ZkClient, 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) IsExist

func (task *TaskGroupWatch) IsExist(data interface{}) bool

IsExist check data exist in local dataCache

func (*TaskGroupWatch) UpdateEvent

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

UpdateEvent when update

type WatchInterface

type WatchInterface interface {
	cluster.DataExister
	cluster.EventHandler
	// contains filtered or unexported methods
}

WatchInterface define interface for watch

type ZkClient

type ZkClient interface {
	ConnectEx(sessionTimeOut time.Duration) error
	GetEx(path string) ([]byte, *zk.Stat, error)
	GetW(path string) ([]byte, *zk.Stat, <-chan zk.Event, error)
	GetChildrenEx(path string) ([]string, *zk.Stat, error)
	ChildrenW(path string) ([]string, *zk.Stat, <-chan zk.Event, error)
	ExistEx(path string) (bool, *zk.Stat, error)
	State() zk.State
	Close()
}

ZkClient interface to define zk operation interface is only use for dependency injection

Jump to

Keyboard shortcuts

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