transfer

package
v0.0.0-...-432d548 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	C2PlatformKey = "app.c2.io/platform"

	SchTypeRole  = "role"
	SchTypeGroup = "group"
	SchTypeNode  = "node"
)

c2 keys

View Source
const (
	StPkgFailed      = 0
	StUnKnown        = 1
	StDead           = 2
	StProcFailed     = 3
	StProcRestarting = 4
	StRunning        = 5
	StProcTerminated = 6
)
enum SlotType {
   ST_PKG_FAILED = 0,
   ST_UNKNOWN,
   ST_DEAD,
   ST_PROC_FAILED,
   ST_PROC_RESTARTING,
   ST_PROC_RUNNING
};

Variables

This section is empty.

Functions

func AppendPlatfrom

func AppendPlatfrom(labels map[string]string)

AppendPlatfrom ...

func ConvertWorkerFromGroupPlan

func ConvertWorkerFromGroupPlan(carbonJob *carbonv1.CarbonJob, hippoCluster, appName, groupID string, groupPlan *typespec.GroupPlan) (map[string]*WorkerNodeConvertResult, error)

ConvertWorkerFromGroupPlan ConvertWorkerFromGroupPlan

func CreateTemplate

func CreateTemplate(appName, groupID, roleID string, role *typespec.RolePlan, schType string) (*carbonv1.HippoPodTemplate, *scheduleParams, error)

CreateTemplate creates pod template

func EscapeName

func EscapeName(name string) string

EscapeName for kube-apiserver

func EscapeNamespace

func EscapeNamespace(namespace string) string

EscapeNamespace for kube-apiserver

func EscapeNamespace2

func EscapeNamespace2(namespace string) string

EscapeNamespace2 for kube-apiserver

func GenerateHippoRoleName

func GenerateHippoRoleName(groupID, roleID string) string

GenerateHippoRoleName GenerateHippoRoleName

func GeneratePodSpec

func GeneratePodSpec(hippoPodSpec *carbonv1.HippoPodSpec, version string, containersVersion map[string]string) (*corev1.PodSpec, *carbonv1.HippoPodSpecExtend, error)

GeneratePodSpec GeneratePodSpec

func GenerateRollingsetName

func GenerateRollingsetName(appName, groupID, roleID string, schType string) (string, error)

GenerateRollingsetName GenerateRollingsetName

func GetArgsFromHippoProcessInfo

func GetArgsFromHippoProcessInfo(p *hippo.ProcessInfo) []string

GetArgsFromHippoProcessInfo GetArgsFromHippoProcessInfo

func GetBrokenRecoverQuotaConfig

func GetBrokenRecoverQuotaConfig(g *typespec.GlobalPlan) *carbonv1.BrokenRecoverQuotaConfig

GetBrokenRecoverQuotaConfig GetBrokenRecoverQuotaConfig

func GetEnvs

func GetEnvs(p *typespec.ProcessInfo) ([]corev1.EnvVar, error)

GetEnvs GetEnvs

func GetEnvsFromHippoProcessInfo

func GetEnvsFromHippoProcessInfo(p *hippo.ProcessInfo) ([]corev1.EnvVar, error)

GetEnvsFromHippoProcessInfo GetEnvsFromHippoProcessInfo

func GetGroupAndRoleID

func GetGroupAndRoleID(object metav1.Object) (string, string)

GetGroupAndRoleID GetGroupAndRoleID

func GetGroupNameSpace

func GetGroupNameSpace(admin, quota, name string) string

GetGroupNameSpace GetGroupNameSpace

func GetHealthCheckerConfig

func GetHealthCheckerConfig(g *typespec.GlobalPlan) *carbonv1.HealthCheckerConfig

GetHealthCheckerConfig GetHealthCheckerConfig

func GetRoleID

func GetRoleID(groupID string, rollingSet *carbonv1.RollingSet) string

GetRoleID get role id from rollingSet

func GetRoleNameSpace

func GetRoleNameSpace(admin, quota, name string) string

GetRoleNameSpace GetRoleNameSpace

func InitFlags

func InitFlags(flagset *pflag.FlagSet)

InitFlags is for explicitly initializing the flags.

func IsMasterFrameworkMode

func IsMasterFrameworkMode(rolePlan *typespec.RolePlan) bool

IsMasterFrameworkMode 为了兼容masterFramework中特殊且待废弃的逻辑, 对这部分服务提供的特殊标识 1) 用于bs监控(?); 2) 用于兼容master framework 进程instanceId 问题

func MergeEnvs

func MergeEnvs(containerEnvs, processEnvs []corev1.EnvVar) []corev1.EnvVar

func SubGroupName

func SubGroupName(groupName string) string

SubGroupName SubGroupName

func TransAllocStatus

func TransAllocStatus(worker *carbonv1.WorkerNode) (*carbon.SlotAllocStatus, error)

TransAllocStatus TransAllocStatus

func TransCloneSetToGroupStatus

func TransCloneSetToGroupStatus(cloneSet *v1alpha1.CloneSet, pods []*corev1.Pod) (*carbon.GroupStatus, error)

func TransGroupToGangRollingset

func TransGroupToGangRollingset(cluster, app string, groupPlan *typespec.GroupPlan, shardgroupName string) (*carbonv1.RollingSet, []*carbonv1.ServicePublisher, error)

TransGroupToGangRollingset trans carbon plan to gang rollingset

func TransGroupToShardGroup

func TransGroupToShardGroup(cluster, app string, groupPlan *typespec.GroupPlan, shardgroupName string, newCreated bool) (*carbonv1.ShardGroup, []*carbonv1.ServicePublisher, error)

TransGroupToShardGroup trans carbon plan to shardGroup

func TransHealthInfo

func TransHealthInfo(worker *carbonv1.WorkerNode) (*carbon.HealthInfo, error)

TransHealthInfo TransHealthInfo

func TransHealthType

func TransHealthType(worker *carbonv1.WorkerNode) (*carbon.HealthType, error)

TransHealthType TransHealthType

func TransReplicaStatus

func TransReplicaStatus(rollingSet *carbonv1.RollingSet, worker *carbonv1.WorkerNode, pod *corev1.Pod,
	backupworker *carbonv1.WorkerNode, backuppod *corev1.Pod) (*carbon.ReplicaNodeStatus, error)

TransReplicaStatus TransReplicaStatus

func TransRoleSlotStatus

func TransRoleSlotStatus(worker *carbonv1.WorkerNode, restarting bool) (*carbon.SlotStatus, error)

TransRoleSlotStatus TransRoleSlotStatus

func TransRoleStatus

func TransRoleStatus(groupID string, rollingSet *carbonv1.RollingSet, replicas []ReplicaNodes) (*carbon.RoleStatusValue, error)

TransRoleStatus TransRoleStatus

func TransServiceInfo

func TransServiceInfo(worker *carbonv1.WorkerNode) (*carbon.ServiceStatus, error)

TransServiceInfo TransServiceInfo

func TransServiceType

func TransServiceType(worker *carbonv1.WorkerNode) (*carbon.ServiceType, error)

TransServiceType TransServiceType

func TransSlotInfo

func TransSlotInfo(worker *carbonv1.WorkerNode, pod *corev1.Pod) (*carbon.SlotInfo, bool, error)

TransSlotInfo TransSlotInfo

func TransWorkerNodeStatusLabels

func TransWorkerNodeStatusLabels(worker *carbonv1.WorkerNode, pod *corev1.Pod) (map[string]string, error)

TransWorkerNodeStatusLabels TransWorkerNodeStatusLabels

func TransWorkerNodesToGroupStatusList

func TransWorkerNodesToGroupStatusList(appName string, workerNodes []carbonv1.WorkerNode, pods []corev1.Pod) ([]*carbon.GroupStatus, error)

TransWorkerNodesToGroupStatusList ...用于生成Status

func TransWorkerStatus

func TransWorkerStatus(rollingSet *carbonv1.RollingSet, worker *carbonv1.WorkerNode, pod *corev1.Pod) (*carbon.WorkerNodeStatus, error)

TransWorkerStatus TransWorkerStatus

func TransWorkerType

func TransWorkerType(worker *carbonv1.WorkerNode) (*carbon.WorkerType, error)

TransWorkerType TransWorkerType

Types

type DefaultWorkerNodeSpecConverter

type DefaultWorkerNodeSpecConverter struct{}

func (*DefaultWorkerNodeSpecConverter) Convert

type ReplicaNodes

type ReplicaNodes struct {
	Worker       *carbonv1.WorkerNode
	Pod          *corev1.Pod
	BackupWorker *carbonv1.WorkerNode
	BackupPod    *corev1.Pod
}

ReplicaNodes ReplicaNodes

type TransSpecResult

type TransSpecResult struct {
	Rollingset *carbonv1.RollingSet
	Services   []*carbonv1.ServicePublisher
	ZoneName   string
}

TransSpecResult is the result of trans carbon plan

func TransGroupToRollingsets

func TransGroupToRollingsets(cluster, app, rollingSetName string, groupPlan *typespec.GroupPlan, newCreated bool) ([]*TransSpecResult, error)

TransGroupToRollingsets trans carbon plan to rollingsets

func TransRoleToRollingsets

func TransRoleToRollingsets(cluster, app, appChecksum, groupID, roleID string, role *typespec.RolePlan,
	schType string, single bool, shardgroupName, rollingSetName string, newCreated bool) (*TransSpecResult, error)

TransRoleToRollingsets trans role plan to rollingsets

type WorkerNodeConvertResult

type WorkerNodeConvertResult struct {
	WorkerNode *carbonv1.WorkerNode
	Immutable  bool
}

WorkerNodeConvertResult WorkerNodeConvertResult

type WorkerNodeSpecConverter

type WorkerNodeSpecConverter interface {
	Convert(*carbonv1.CarbonJob) (map[string]*WorkerNodeConvertResult, error)
}

workerNodeSpecConverter 用于将GroupPlan转换为workerNodeSpec

func NewWorkerNodeSpecConverter

func NewWorkerNodeSpecConverter() WorkerNodeSpecConverter

Jump to

Keyboard shortcuts

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