Documentation
¶
Index ¶
- Constants
- func AddRuntimesIfNotExist(runtimes []data.Runtime, newRuntime data.Runtime) (updatedRuntimes []data.Runtime)
- func BytesSize(size float64) string
- func ContainsString(slice []string, s string) bool
- func FromHumanSize(size string) (int64, error)
- func GetAlluxioRuntime(client client.Client, name, namespace string) (*data.AlluxioRuntime, error)
- func GetChartsDirectory() 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 GetMountRoot() string
- 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 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 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 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 ContainsString ¶
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 GetAlluxioRuntime ¶
GetAlluxioRuntime gets Alluxio Runtime object with the given name and namespace
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)
get dataset condition given a 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 GetMountRoot ¶ added in v0.4.0
func GetMountRoot() string
GetMountRoot gets the value of the env variable named MOUNT_ROOT
func GetOrDefault ¶
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 HasDeletionTimestamp ¶
func HasDeletionTimestamp(obj metav1.ObjectMeta) bool
HasDeletionTimestamp method that makes logic easier to read.
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 PathExists ¶
func RandomAlphaNumberString ¶
Return 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 ¶
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 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.