Documentation
¶
Index ¶
- Constants
- func AddRuntimesIfNotExist(runtimes []data.Runtime, newRuntime data.Runtime) (updatedRuntimes []data.Runtime)
- func BytesSize(size float64) string
- func ContainsOwners(owners []metav1.OwnerReference, dataset *datav1alpha1.Dataset) bool
- func ContainsSelector(labels map[string]string, selector map[string]string) bool
- func ContainsString(slice []string, s string) bool
- func FillSliceWithString(str string, num int) *[]string
- func FromHumanSize(size string) (int64, error)
- func GetAccessModesOfDataset(client client.Client, name, namespace string) (accessModes []v1.PersistentVolumeAccessMode, err error)
- func GetAddressOfMaster(pod *v1.Pod) (nodeName string, ip string, rpcPort int32)
- func GetAlluxioRuntime(client client.Client, name, namespace string) (*data.AlluxioRuntime, error)
- func GetChartsDirectory() string
- func GetDataBackup(client client.Client, name, namespace string) (*datav1alpha1.DataBackup, error)
- func GetDataBackupPodName(name string) string
- func GetDataBackupRef(name, namespace string) string
- func GetDataBackupReleaseName(name string) string
- func GetDataLoad(client client.Client, name, namespace string) (*datav1alpha1.DataLoad, error)
- func GetDataLoadJob(client client.Client, name, namespace string) (*batchv1.Job, error)
- func GetDataLoadJobName(releaseName string) string
- func GetDataLoadRef(name, namespace string) string
- func GetDataLoadReleaseName(name string) string
- func GetDataset(client client.Client, name, namespace string) (*datav1alpha1.Dataset, error)
- func GetDatasetCondition(conditions []datav1alpha1.DatasetCondition, ...) (index int, condition *datav1alpha1.DatasetCondition)
- func GetExclusiveKey() string
- func GetExclusiveValue(namespace, name string) string
- func GetMountRoot() (string, error)
- func GetOrDefault(str *string, defaultValue string) string
- func GetRuntimeByCategory(runtimes []datav1alpha1.Runtime, category common.Category) (index int, runtime *datav1alpha1.Runtime)
- func GetRuntimeCondition(conditions []data.RuntimeCondition, condType data.RuntimeConditionType) (index int, condition *data.RuntimeCondition)
- func GetSecret(client client.Client, name, namespace string) (*v1.Secret, error)
- func HasDeletionTimestamp(obj metav1.ObjectMeta) bool
- func Home() (string, error)
- func IgnoreNotFound(err error) error
- func IsDatasetConditionExist(conditions []datav1alpha1.DatasetCondition, cond datav1alpha1.DatasetCondition) (found bool)
- func IsSetupDone(dataset *datav1alpha1.Dataset) (done bool)
- func NewDatasetCondition(conditionType datav1alpha1.DatasetConditionType, reason, message string, ...) datav1alpha1.DatasetCondition
- func NewRuntime(name, namespace string, category common.Category, runtimeType string) data.Runtime
- func NewRuntimeCondition(conditionType data.RuntimeConditionType, reason, message string, ...) data.RuntimeCondition
- func NoRequeue() (ctrl.Result, error)
- func Now() *metav1.Time
- func ParseBackupRestorePath(backupRestorePath string) (pvcName string, path string, err error)
- func PathExists(path string) bool
- func RandomAlphaNumberString(l int32) string
- func RandomString(source []rune, l int32) string
- func RemoveString(slice []string, s string) (result []string)
- func RequeueAfterInterval(interval time.Duration) (ctrl.Result, error)
- func RequeueIfError(err error) (ctrl.Result, error)
- func RequeueImmediately() (ctrl.Result, error)
- func RequeueImmediatelyUnlessGenerationChanged(prevGeneration, curGeneration int64) (ctrl.Result, error)
- func SplitSchemaAddr(addr string) (string, string)
- func ToYaml(values interface{}, file *os.File) error
- func TranformQuantityToAlluxioUnit(q *resource.Quantity) (value string)
- func TranformQuantityToJindoUnit(q *resource.Quantity) (value string)
- func TranformQuantityToUnits(q *resource.Quantity) (value string)
- func TransformRequirementsToResources(res corev1.ResourceRequirements) (cRes common.Resources)
- func UpdateDatasetCondition(conditions []datav1alpha1.DatasetCondition, ...) []datav1alpha1.DatasetCondition
- func UpdateRuntimeCondition(conditions []data.RuntimeCondition, condition data.RuntimeCondition) []data.RuntimeCondition
Constants ¶
const ( KB = 1024 MB = 1024 * KB GB = 1024 * MB TB = 1024 * GB PB = 1024 * TB )
const MountRoot string = "MOUNT_ROOT"
Variables ¶
This section is empty.
Functions ¶
func AddRuntimesIfNotExist ¶
func AddRuntimesIfNotExist(runtimes []data.Runtime, newRuntime data.Runtime) (updatedRuntimes []data.Runtime)
AddRuntimesIfNotExist
func BytesSize ¶ added in v0.4.0
BytesSize returns a human-readable size in bytes, kibibytes, mebibytes, gibibytes, or tebibytes, but with a B, kB, MB unit style. This is to make byte units be in consistent with Alluxio See https://github.com/Alluxio/alluxio/blob/master/core/common/src/main/java/alluxio/util/FormatUtils.java#L135
func ContainsOwners ¶ added in v0.5.0
func ContainsOwners(owners []metav1.OwnerReference, dataset *datav1alpha1.Dataset) bool
func ContainsSelector ¶ added in v0.5.0
ContainsSelector Determine whether the labels contain the selector
func ContainsString ¶
ContainsString Determine whether the string array contains a specific string, return true if contains the string and return false if not.
func FillSliceWithString ¶ added in v0.5.0
FillSliceWithString fills a slice with repeated given string
func FromHumanSize ¶ added in v0.4.0
FromHumanSize returns an integer from a human-readable specification of a size with 1024 as multiplier (eg. "44kB" = "(44 * 1024)B").
func GetAccessModesOfDataset ¶ added in v0.5.0
func GetAddressOfMaster ¶ added in v0.5.0
GetAddressOfMaster return the ip and port of alluxio-master
func GetAlluxioRuntime ¶
GetAlluxioRuntime gets Alluxio Runtime object with the given name and namespace
func GetChartsDirectory ¶
func GetChartsDirectory() string
* * // GetChartsDirectory gets the directory of the charts *
func GetDataBackup ¶ added in v0.5.0
func GetDataBackup(client client.Client, name, namespace string) (*datav1alpha1.DataBackup, error)
GetDataBackup gets the DataBackup given its name and namespace
func GetDataBackupPodName ¶ added in v0.5.0
GetDataBackupPodName returns DataBackup pod's name given the DataBackup's name
func GetDataBackupRef ¶ added in v0.5.0
GetDataBackupRef returns the identity of the Backup by combining its namespace and name. The identity is used for identifying current lock holder on the target dataset.
func GetDataBackupReleaseName ¶ added in v0.5.0
GetDataBackupReleaseName returns DataBackup helm release's name given the DataBackup's name
func GetDataLoad ¶
GetDataLoad gets the DataLoad given its name and namespace
func GetDataLoadJob ¶ added in v0.4.0
GetDataLoadJob gets the DataLoad job given its name and namespace
func GetDataLoadJobName ¶ added in v0.4.0
GetDataLoadJobName returns DataLoad job's name given the DataLoad helm release's name
func GetDataLoadRef ¶ added in v0.4.0
GetDataLoadRef returns the identity of the DataLoad by combining its namespace and name. The identity is used for identifying current lock holder on the target dataset.
func GetDataLoadReleaseName ¶ added in v0.4.0
GetDataLoadReleaseName returns DataLoad helm release's name given the DataLoad's name
func GetDataset ¶
GetDataset gets the dataset. It returns a pointer to the dataset if successful.
func GetDatasetCondition ¶
func GetDatasetCondition(conditions []datav1alpha1.DatasetCondition, condType datav1alpha1.DatasetConditionType) (index int, condition *datav1alpha1.DatasetCondition)
GetDatasetCondition returns dataset condition according to a given dataset condition type. If found, return index of the founded condition in the condition array and the founded condition itself, otherwise return -1 and nil.
func GetExclusiveKey ¶ added in v0.5.0
func GetExclusiveKey() string
GetExclusiveKey gets exclusive key
func GetExclusiveValue ¶ added in v0.5.0
GetExclusiveValue gets exclusive value
func GetMountRoot ¶ added in v0.4.0
GetMountRoot gets the value of the env variable named MOUNT_ROOT
func GetOrDefault ¶
GetOrDefault returns the default value unless there is a specified value.
func GetRuntimeByCategory ¶ added in v0.4.0
func GetRuntimeByCategory(runtimes []datav1alpha1.Runtime, category common.Category) (index int, runtime *datav1alpha1.Runtime)
func GetRuntimeCondition ¶
func GetRuntimeCondition(conditions []data.RuntimeCondition, condType data.RuntimeConditionType) (index int, condition *data.RuntimeCondition)
GetRuntimeCondition gets a runtime condition given a runtime condition type. If found, return index of the founded condition in the condition array and the founded condition itself, otherwise return -1 and nil.
func GetSecret ¶ added in v0.5.0
GetSecret gets the secret. It returns a pointer to the secret if successful.
func HasDeletionTimestamp ¶
func HasDeletionTimestamp(obj metav1.ObjectMeta) bool
HasDeletionTimestamp method that makes logic easier to read.
func Home ¶
Home returns the home directory for the executing user. This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.
func IsDatasetConditionExist ¶
func IsDatasetConditionExist(conditions []datav1alpha1.DatasetCondition, cond datav1alpha1.DatasetCondition) (found bool)
IsDatasetConditionExist checks if the given dataset condition exists in the given dataset condition array.
func IsSetupDone ¶ added in v0.4.0
func IsSetupDone(dataset *datav1alpha1.Dataset) (done bool)
checks the setup is done
func NewDatasetCondition ¶
func NewDatasetCondition(conditionType datav1alpha1.DatasetConditionType, reason, message string, status v1.ConditionStatus) datav1alpha1.DatasetCondition
NewDatasetCondition creates a new Cache condition.
func NewRuntime ¶
NewRuntimeCondition creates a new Cache condition.
func NewRuntimeCondition ¶
func NewRuntimeCondition(conditionType data.RuntimeConditionType, reason, message string, status v1.ConditionStatus) data.RuntimeCondition
NewRuntimeCondition creates a new Cache condition.
func ParseBackupRestorePath ¶ added in v0.5.0
ParseBackupRestorePath parse the BackupPath in spec of DataBackup or the RestorePath in spec of Dataset
func PathExists ¶
PathExists returns the specified path is exists or not
func RandomAlphaNumberString ¶
RandomAlphaNumberString returns a string of length l which is made up of runes randomly selected from [0-9a-z].
func RandomString ¶
RandomString returns a string of length l which is made up of runes randomly selected from `source`.
func RemoveString ¶
RemoveString removes strings in a array, which is equal to a given string.
func RequeueAfterInterval ¶
RequeueAfterInterval returns the result of a reconciler invocation with a given requeue interval.
func RequeueIfError ¶
RequeueIfError returns the result of a reconciler invocation and requeue immediately if err is not nil.
func RequeueImmediately ¶
RequeueImmediately returns the result of a reconciler invocation and requeue immediately.
func RequeueImmediatelyUnlessGenerationChanged ¶
func RequeueImmediatelyUnlessGenerationChanged(prevGeneration, curGeneration int64) (ctrl.Result, error)
RequeueImmediatelyUnlessGenerationChanged requeues immediately if the object generation has not changed. Otherwise, since the generation change will trigger an immediate update anyways, this will not requeue. This prevents some cases where two reconciliation loops will occur.
func SplitSchemaAddr ¶
SplitSchemaAddr splits the address string into 2 parts: proto and addr. Proto is set to "tcp" in default. It returns proto and addr separately.
func ToYaml ¶
ToYaml converts values from json format to yaml format and stores the values to the file. It will return err when failed to marshal value or write file.
func TranformQuantityToAlluxioUnit ¶ added in v0.5.0
func TranformQuantityToJindoUnit ¶ added in v0.5.0
func TranformQuantityToUnits ¶ added in v0.5.0
func TransformRequirementsToResources ¶
func TransformRequirementsToResources(res corev1.ResourceRequirements) (cRes common.Resources)
func UpdateDatasetCondition ¶
func UpdateDatasetCondition(conditions []datav1alpha1.DatasetCondition, condition datav1alpha1.DatasetCondition) []datav1alpha1.DatasetCondition
SetDatasetCondition updates the dataset to include the provided condition. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.
func UpdateRuntimeCondition ¶
func UpdateRuntimeCondition(conditions []data.RuntimeCondition, condition data.RuntimeCondition) []data.RuntimeCondition
UpdateRuntimeCondition updates the runtime to include the provided condition. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.
Types ¶
This section is empty.