Skip to content

Refactor label keys in Fluid #978

@TrafalgarZZZ

Description

@TrafalgarZZZ

Currently, most label keys used in Fluid are got from "getXXXLabelName"-style functions with RuntimeInfo or RuntimeEngine as their receivers.

For example:

type RuntimeInfoInterface interface {
	// GetStoragetLabelname(read common.ReadType, storage common.StorageType) string

	GetLabelNameForMemory() string

	GetLabelNameForDisk() string

	GetLabelNameForTotal() string

	GetCommonLabelName() string

	GetRuntimeLabelName() string

	GetDatasetNumLabelName() string
         ....
}

This regards the label keys as members of these structs. While I think it's better to think label keys as a convention defined by Fluid. Therefore, I suggest we should make the functions as common utils. Like:

func GetCommonLabelName(namespace, name string) {
     return common.LabelAnnotationStorageCapacityPrefix + namespace + "-" + name
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions