Documentation ¶
Overview ¶
Copyright 2023 The Fluid Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func AddRuntimesIfNotExist(runtimes []data.Runtime, newRuntime data.Runtime) (updatedRuntimes []data.Runtime)
- func AppContainerPostStartInjectEnabled(infos map[string]string) (match bool)
- func AppControllerDisabled(info map[string]string) (match bool)
- func AppendOrOverrideVolume(volumes []corev1.Volume, vol corev1.Volume) []corev1.Volume
- func AppendOrOverrideVolumeMounts(volumeMounts []corev1.VolumeMount, vm corev1.VolumeMount) []corev1.VolumeMount
- func BytesSize(size float64) string
- func CalculateDuration(creationTime time.Time, finishTime time.Time) string
- func ChangeNodeLabelWithPatchMode(cli client.Client, node *v1.Node, labelsToModify common.LabelsToModify) (modifiedLabels []string, err error)
- func ChangeNodeLabelWithUpdateMode(client client.Client, node *v1.Node, labelsToModify common.LabelsToModify) (modifiedLabels []string, err error)
- func CheckMountPointBroken(mountPath string) (broken bool, err error)
- func CheckMountReadyAndSubPathExist(fluidPath string, mountType string, subPath string) error
- func CheckObject(client client.Client, key types.NamespacedName, obj client.Object) (found bool, err error)
- func ContainsAll(m map[string]string, slice []string) bool
- 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 ContainsSubString(slice []string, s string) bool
- func CreateRuntimeForReferenceDatasetIfNotExist(client client.Client, dataset *datav1alpha1.Dataset) (err error)
- func DumpJSON(o interface{}) string
- func FillSliceWithString(str string, num int) *[]string
- func FilterVolumesByVolumeMounts(volumes []corev1.Volume, volumeMounts []corev1.VolumeMount) []corev1.Volume
- func FindVolumeByVolumeMount(volumeMount corev1.VolumeMount, volumes []corev1.Volume) *corev1.Volume
- func FromHumanSize(size string) (int64, error)
- func FromRawToObject(raw []byte) (obj runtime.Object, err error)
- func FuseSidecarEnabled(infos map[string]string) (match bool)
- func FuseSidecarUnprivileged(infos map[string]string) (match bool)
- func GetAccessModesOfDataset(client client.Client, name, namespace string) (accessModes []corev1.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 GetBackupUserDir(namespace string, name string) string
- func GetBoolValueFormEnv(key string, defaultValue bool) (value bool)
- func GetChartsDirectory() string
- func GetDataBackup(client client.Client, name, namespace string) (*datav1alpha1.DataBackup, error)
- func GetDataBackupPodName(name 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 GetDataMigrate(client client.Client, name, namespace string) (*datav1alpha1.DataMigrate, error)
- func GetDataMigrateJob(client client.Client, name, namespace string) (*batchv1.Job, error)
- func GetDataMigrateJobName(releaseName string) string
- func GetDataMigrateRef(name, namespace string) string
- func GetDataMigrateReleaseName(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 GetDurationValueFromEnv(key string, defaultValue time.Duration) (value time.Duration)
- func GetEFCRuntime(client client.Client, name, namespace string) (*data.EFCRuntime, error)
- func GetEnvByKey(k string) (string, error)
- func GetExclusiveKey() string
- func GetExclusiveValue(namespace, name string) string
- func GetGooseFSRuntime(client client.Client, name, namespace string) (*data.GooseFSRuntime, error)
- func GetInitUserEnv(user *datav1alpha1.User) string
- func GetInitUsersArgs(user *datav1alpha1.User) []string
- func GetIntValueFormEnv(key string) (value int, found bool)
- func GetJindoRuntime(client client.Client, name, namespace string) (*data.JindoRuntime, error)
- func GetJuiceFSRuntime(client client.Client, name, namespace string) (*data.JuiceFSRuntime, error)
- func GetMountRoot() (string, error)
- func GetObjectMeta(object client.Object) (objectMeta metav1.Object, err error)
- func GetOrDefault(str *string, defaultValue string) string
- func GetRpcPortFromMasterContainer(container *v1.Container) (rpcPort int32)
- 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 GetRuntimeNameFromFusePod(pod corev1.Pod) (runtimeName string, err error)
- func GetStringValueFromEnv(key string, defaultValue string) (value string)
- func GetTargetDatasetOfMigrate(client client.Client, dataMigrate datav1alpha1.DataMigrate) (targetDataset *datav1alpha1.Dataset, err error)
- func GetThinRuntime(client client.Client, name, namespace string) (*data.ThinRuntime, error)
- func GetThinRuntimeProfile(client client.Client, name string) (*data.ThinRuntimeProfile, error)
- func HasDeletionTimestamp(obj metav1.ObjectMeta) bool
- func Home() (string, error)
- func IgnoreAlreadyExists(err error) error
- func IgnoreNoKindMatchError(err error) error
- func IgnoreNotFound(err error) error
- func InjectCacheDirEnabled(infos map[string]string) (match bool)
- func InjectMountPropagation(datasetNames []string, pod *corev1.Pod)
- func InjectNodeSelectorTerms(requiredSchedulingTerms []corev1.NodeSelectorTerm, pod *corev1.Pod)
- func InjectPreferredSchedulingTerms(preferredSchedulingTerms []corev1.PreferredSchedulingTerm, pod *corev1.Pod)
- func InjectSidecarDone(infos map[string]string) (match bool)
- func IsDatasetConditionExist(conditions []datav1alpha1.DatasetCondition, cond datav1alpha1.DatasetCondition) (found bool)
- func IsFusePod(pod corev1.Pod) bool
- func IsMounted(absPath string) (bool, error)
- func IsPodManagedByFluid(pod *corev1.Pod) bool
- func IsSetupDone(dataset *datav1alpha1.Dataset) (done bool)
- func IsSubPath(path, subPath string) bool
- func IsTargetPathUnderFluidNativeMounts(targetPath string, dataset datav1alpha1.Dataset) bool
- func IsTimeTrackerDebugEnabled() bool
- func IsTimeTrackerEnabled() bool
- func LoggingErrorExceptConflict(logging logr.Logger, err error, info string, ...) (result error)
- func NewDatasetCondition(conditionType datav1alpha1.DatasetConditionType, reason, message string, ...) datav1alpha1.DatasetCondition
- func NewPprofServer(setupLog logr.Logger, pprofAddr string, enableFullGoProfile bool)
- 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 PatchLabels(cli client.Client, obj client.Object, labelsToModify common.LabelsToModify) (modifiedLabels []string, err error)
- func PathExists(path string) bool
- func RandomAlphaNumberString(l int32) string
- func RandomReplacePrefix(input string, l int) (output string)
- func RandomString(source []rune, l int32) string
- func RemoveDuplicateStr(strSlice []string) []string
- func RemoveString(slice []string, s string) (result []string)
- func ReplacePrefix(input, suffix string) (output 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 ResourceRequirementsEqual(source corev1.ResourceRequirements, target corev1.ResourceRequirements) bool
- func ServerfulFuseEnabled(infos map[string]string) (match bool)
- func ServerlessEnabled(infos map[string]string) (match bool)
- func ServerlessPlatformMatched(infos map[string]string) (match bool)
- func SortIpAddresses(ips []string) (orderedIps []string)
- func SplitSchemaAddr(addr string) (string, string)
- func SubtractString(x []string, y []string) []string
- func TimeTrack(start time.Time, processName string, keysAndValues ...interface{})
- func ToYaml(values interface{}, file *os.File) error
- func TranformQuantityToUnits(q *resource.Quantity) (value string)
- func TransformEFCUnitToQuantity(value string) (q *resource.Quantity)
- func TransformQuantityToAlluxioUnit(q *resource.Quantity) (value string)
- func TransformQuantityToEFCUnit(q *resource.Quantity) (value string)
- func TransformQuantityToGooseFSUnit(q *resource.Quantity) (value string)
- func TransformQuantityToJindoUnit(q *resource.Quantity) (value string)
- func TransformRequirementsToResources(res corev1.ResourceRequirements) (cRes common.Resources)
- func TrimCapabilities(inputs []corev1.Capability, excludeNames []string) (outputs []corev1.Capability)
- func TrimVolumeMounts(inputs []corev1.VolumeMount, excludeNames []string) (outputs []corev1.VolumeMount)
- func TrimVolumes(inputs []corev1.Volume, excludeNames []string) (outputs []corev1.Volume)
- func UnionMapsWithOverride(map1 map[string]string, map2 map[string]string) map[string]string
- func UpdateDatasetCondition(conditions []datav1alpha1.DatasetCondition, ...) []datav1alpha1.DatasetCondition
- func UpdateMountStatus(client client.Client, name string, namespace string, ...) error
- func UpdateRuntimeCondition(conditions []data.RuntimeCondition, condition data.RuntimeCondition) []data.RuntimeCondition
- func WorkerSidecarEnabled(infos map[string]string) (match bool)
- type UFSPathBuilder
- func (u UFSPathBuilder) GenAlluxioMountPath(curMount datav1alpha1.Mount, mounts []datav1alpha1.Mount) string
- func (u UFSPathBuilder) GenAlluxioUFSRootPath(items []datav1alpha1.Mount) (string, *datav1alpha1.Mount)
- func (u UFSPathBuilder) GenLocalStoragePath(curMount datav1alpha1.Mount) string
- func (u UFSPathBuilder) GetLocalStorageRootDir() string
- type UFSToUpdate
Constants ¶
const ( KiB = 1024 MiB = 1024 * KiB GiB = 1024 * MiB TiB = 1024 * GiB PiB = 1024 * TiB EiB = 1024 * PiB )
const MountRoot string = "MOUNT_ROOT"
Variables ¶
var ( ServerlessPlatformKey string = "" ServerlessPlatformVal string = "" )
Functions ¶
func AddRuntimesIfNotExist ¶
func AddRuntimesIfNotExist(runtimes []data.Runtime, newRuntime data.Runtime) (updatedRuntimes []data.Runtime)
AddRuntimesIfNotExist adds newRuntime to runtimes and return the updated runtime slice
func AppContainerPostStartInjectEnabled ¶ added in v0.8.0
func AppControllerDisabled ¶ added in v0.8.0
func AppendOrOverrideVolume ¶ added in v0.9.0
func AppendOrOverrideVolumeMounts ¶ added in v0.9.0
func AppendOrOverrideVolumeMounts(volumeMounts []corev1.VolumeMount, vm corev1.VolumeMount) []corev1.VolumeMount
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 CalculateDuration ¶ added in v0.6.0
CalculateDuration generates a string of duration from creationTime and finishTime if finish time is zero, use current time as default
func ChangeNodeLabelWithPatchMode ¶ added in v0.6.0
func ChangeNodeLabelWithPatchMode(cli client.Client, node *v1.Node, labelsToModify common.LabelsToModify) (modifiedLabels []string, err error)
ChangeNodeLabelWithPatchMode updates the input labels in PATCH mode.
func ChangeNodeLabelWithUpdateMode ¶ added in v0.6.0
func ChangeNodeLabelWithUpdateMode(client client.Client, node *v1.Node, labelsToModify common.LabelsToModify) (modifiedLabels []string, err error)
ChangeNodeLabelWithUpdateMode updates the input labels in UPDATE mode.
func CheckMountPointBroken ¶ added in v0.7.0
func CheckMountReadyAndSubPathExist ¶ added in v0.9.0
func CheckObject ¶ added in v0.8.0
func ContainsAll ¶ added in v0.6.0
ContainsAll checks if a map contains all the elements in a slice
func ContainsOwners ¶ added in v0.5.0
func ContainsOwners(owners []metav1.OwnerReference, dataset *datav1alpha1.Dataset) bool
ContainsOwners Determine whether the slice of owners contains the owner of a Dataset return true if contains the owner and return false if not.
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 ContainsSubString ¶ added in v0.8.0
ContainsSubString Determine whether the string array contains a sub string return true if contains the string and return false if not.
func CreateRuntimeForReferenceDatasetIfNotExist ¶ added in v0.9.0
func CreateRuntimeForReferenceDatasetIfNotExist(client client.Client, dataset *datav1alpha1.Dataset) (err error)
CreateRuntimeForReferenceDatasetIfNotExist creates runtime for ReferenceDataset
func DumpJSON ¶ added in v0.8.0
func DumpJSON(o interface{}) string
DumpJSON returns the JSON encoding
func FillSliceWithString ¶ added in v0.5.0
FillSliceWithString fills a slice with repeated given string
func FilterVolumesByVolumeMounts ¶ added in v0.9.0
func FilterVolumesByVolumeMounts(volumes []corev1.Volume, volumeMounts []corev1.VolumeMount) []corev1.Volume
FilterVolumesByVolumeMounts returns volumes that exists in the volumeMounts
func FindVolumeByVolumeMount ¶ added in v0.9.0
func FromHumanSize ¶ added in v0.4.0
FromHumanSize returns an integer from a human-readable specification of a size with 1024 as multiplier e.g.:
- 1 KiB = 1024 byte
func FromRawToObject ¶ added in v0.7.0
FromRawToObject is used to convert from raw to the runtime object
func FuseSidecarEnabled ¶ added in v0.7.0
func FuseSidecarUnprivileged ¶ added in v0.8.0
func GetAccessModesOfDataset ¶ added in v0.5.0
func GetAddressOfMaster ¶ added in v0.5.0
GetAddressOfMaster return the ip and port of engine master
func GetAlluxioRuntime ¶
GetAlluxioRuntime gets Alluxio Runtime object with the given name and namespace
func GetBackupUserDir ¶ added in v0.6.0
GetBackupUserDir generate the temp dir of backup user
func GetBoolValueFormEnv ¶ added in v0.8.0
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 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 GetDataMigrate ¶ added in v0.9.0
func GetDataMigrate(client client.Client, name, namespace string) (*datav1alpha1.DataMigrate, error)
GetDataMigrate gets the DataMigrate given its name and namespace
func GetDataMigrateJob ¶ added in v0.9.0
GetDataMigrateJob gets the DataMigrate job given its name and namespace
func GetDataMigrateJobName ¶ added in v0.9.0
GetDataMigrateJobName returns DataMigrate job's name given the DataMigrate helm release's name
func GetDataMigrateRef ¶ added in v0.9.0
GetDataMigrateRef returns the identity of the DataMigrate by combining its namespace and name. The identity is used for identifying current lock holder on the target dataset.
func GetDataMigrateReleaseName ¶ added in v0.9.0
GetDataMigrateReleaseName returns DataMigrate helm release's name given the DataMigrate'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 GetDurationValueFromEnv ¶ added in v0.8.0
func GetEFCRuntime ¶ added in v0.9.0
GetEFCRuntime gets EFC Runtime object with the given name and namespace
func GetEnvByKey ¶ added in v0.6.0
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 GetGooseFSRuntime ¶ added in v0.6.0
GetGooseFSRuntime gets GooseFS Runtime object with the given name and namespace
func GetInitUserEnv ¶ added in v0.6.0
func GetInitUserEnv(user *datav1alpha1.User) string
func GetInitUsersArgs ¶ added in v0.6.0
func GetInitUsersArgs(user *datav1alpha1.User) []string
func GetIntValueFormEnv ¶ added in v0.8.0
func GetJindoRuntime ¶ added in v0.6.0
GetJindoRuntime gets Jindo Runtime object with the given name and namespace
func GetJuiceFSRuntime ¶ added in v0.7.0
GetJuiceFSRuntime gets JuiceFS Runtime object with the given name and namespace
func GetMountRoot ¶ added in v0.4.0
GetMountRoot gets the value of the env variable named MOUNT_ROOT
func GetObjectMeta ¶ added in v0.9.0
func GetOrDefault ¶
GetOrDefault returns the default value unless there is a specified value.
func GetRpcPortFromMasterContainer ¶ added in v0.6.0
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 GetRuntimeNameFromFusePod ¶ added in v0.7.0
func GetStringValueFromEnv ¶ added in v0.8.0
func GetTargetDatasetOfMigrate ¶ added in v0.9.0
func GetTargetDatasetOfMigrate(client client.Client, dataMigrate datav1alpha1.DataMigrate) (targetDataset *datav1alpha1.Dataset, err error)
func GetThinRuntime ¶ added in v0.9.0
func GetThinRuntimeProfile ¶ added in v0.9.0
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 IgnoreAlreadyExists ¶ added in v0.8.0
IgnoreAlreadyExists ignores already existes error
func IgnoreNoKindMatchError ¶ added in v0.9.0
func InjectCacheDirEnabled ¶ added in v0.7.0
func InjectMountPropagation ¶ added in v0.7.0
func InjectNodeSelectorTerms ¶ added in v0.6.0
func InjectNodeSelectorTerms(requiredSchedulingTerms []corev1.NodeSelectorTerm, pod *corev1.Pod)
InjectRequiredSchedulingTerms inject the NodeSelectorTerms into a pod
func InjectPreferredSchedulingTerms ¶ added in v0.6.0
func InjectPreferredSchedulingTerms(preferredSchedulingTerms []corev1.PreferredSchedulingTerm, pod *corev1.Pod)
InjectPreferredSchedulingTerms inject the preferredSchedulingTerms into a pod
func InjectSidecarDone ¶ added in v0.7.0
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 IsPodManagedByFluid ¶ added in v0.9.0
IsPodManagedByFluid checks if the given Pod is managed by Fluid.
func IsSetupDone ¶ added in v0.4.0
func IsSetupDone(dataset *datav1alpha1.Dataset) (done bool)
checks the setup is done
func IsTargetPathUnderFluidNativeMounts ¶ added in v0.6.0
func IsTargetPathUnderFluidNativeMounts(targetPath string, dataset datav1alpha1.Dataset) bool
IsTargetPathUnderFluidNativeMounts checks if targetPath is a subpath under some given native mount point. We check this for the reason that native mount points need extra metadata sync alluxioOperations.
func IsTimeTrackerDebugEnabled ¶ added in v0.8.0
func IsTimeTrackerDebugEnabled() bool
func IsTimeTrackerEnabled ¶ added in v0.8.0
func IsTimeTrackerEnabled() bool
func LoggingErrorExceptConflict ¶ added in v0.7.0
func LoggingErrorExceptConflict(logging logr.Logger, err error, info string, namespacedKey types.NamespacedName) (result error)
LoggingErrorExceptConflict logs error except for updating operation violates with etcd concurrency control
func NewDatasetCondition ¶
func NewDatasetCondition(conditionType datav1alpha1.DatasetConditionType, reason, message string, status v1.ConditionStatus) datav1alpha1.DatasetCondition
NewDatasetCondition creates a new Cache condition.
func NewPprofServer ¶ added in v0.7.0
func NewRuntime ¶
func NewRuntime(name, namespace string, category common.Category, runtimeType string, replicas int32) data.Runtime
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 NoRequeue ¶
NoRequeue returns the result of a reconcile invocation and no err The Object will not requeue
func ParseBackupRestorePath ¶ added in v0.5.0
ParseBackupRestorePath parse the BackupPath in spec of DataBackup or the RestorePath in spec of Dataset
func PatchLabels ¶ added in v0.9.0
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 RandomReplacePrefix ¶ added in v0.7.0
func RandomString ¶
RandomString returns a string of length l which is made up of runes randomly selected from `source`.
func RemoveDuplicateStr ¶ added in v0.7.0
RemoveDuplicateStr removes duplicate string
func RemoveString ¶
RemoveString removes strings in a array, which is equal to a given string.
func ReplacePrefix ¶ added in v0.7.0
ReplacePrefix replaces the input with suffix string
func RequeueAfterInterval ¶
RequeueAfterInterval returns the result of a reconcile invocation with a given requeue interval and no err The Object will requeue after the given requeue interval
func RequeueIfError ¶
RequeueIfError returns the result of a reconciler invocation and the err The Object will requeue when err is not nil
func RequeueImmediately ¶
RequeueImmediately returns the result of a reconciler invocation and no err The Object will requeue immediately whether the err is nil or not
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 ResourceRequirementsEqual ¶ added in v0.8.0
func ResourceRequirementsEqual(source corev1.ResourceRequirements, target corev1.ResourceRequirements) bool
func ServerfulFuseEnabled ¶ added in v0.9.0
func ServerlessEnabled ¶ added in v0.7.0
func ServerlessPlatformMatched ¶ added in v0.8.0
func SortIpAddresses ¶ added in v0.9.0
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 SubtractString ¶ added in v0.6.0
SubtractString returns the subtraction between two string slice
func TimeTrack ¶ added in v0.6.0
TimeTrack tracks the time cost for some process with some optional information. For example, to track the processing time of a function, just add the following code at the beginning of your function:
defer utils.TimeTrack(time.Now(), <func-name>, <keysAndValues>...)
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 TranformQuantityToUnits ¶ added in v0.5.0
TransformQuantityToUnits returns a human-readable size in bytes, kibibytes, mebibytes, gibibytes, or tebibytes (eg. "44kiB", "17MiB").
func TransformEFCUnitToQuantity ¶ added in v0.9.0
func TransformQuantityToAlluxioUnit ¶ added in v0.6.0
TransformQuantityToAlluxioUnit transform a given input quantity to another one that can be recognized by Alluxio. This is necessary because Alluxio takes decimal byte units(e.g. KB, MB, GB, etc.) as binary byte units(e.g. Ki, Mi, Gi)
func TransformQuantityToEFCUnit ¶ added in v0.9.0
TransformQuantityToEFCUnit transform a given input quantity to another one that can be recognized by EFC. This is necessary because EFC takes decimal byte units(e.g. KB, MB, GB, etc.) as binary byte units(e.g. Ki, Mi, Gi)
func TransformQuantityToGooseFSUnit ¶ added in v0.6.0
TransformQuantityToGooseFSUnit transform a given input quantity to another one that can be recognized by GooseFS. This is necessary because GooseFS takes decimal byte units(e.g. KB, MB, GB, etc.) as binary byte units(e.g. Ki, Mi, Gi)
func TransformQuantityToJindoUnit ¶ added in v0.6.0
TransfromQuantityToJindoUnit transform a given input quantity to another one that can be recognized by Jindo.
func TransformRequirementsToResources ¶
func TransformRequirementsToResources(res corev1.ResourceRequirements) (cRes common.Resources)
func TrimCapabilities ¶ added in v0.8.0
func TrimCapabilities(inputs []corev1.Capability, excludeNames []string) (outputs []corev1.Capability)
func TrimVolumeMounts ¶ added in v0.7.0
func TrimVolumeMounts(inputs []corev1.VolumeMount, excludeNames []string) (outputs []corev1.VolumeMount)
func TrimVolumes ¶ added in v0.7.0
TrimVolumes trims the volumes
func UnionMapsWithOverride ¶ added in v0.8.0
UnionMapsWithOverride unions two maps into one. If either of the maps is empty, return the other one. If both maps share the same key, the value in map2 overrides the corresponding value in map1.
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 UpdateMountStatus ¶ added in v0.6.0
func UpdateMountStatus(client client.Client, name string, namespace string, phase datav1alpha1.DatasetPhase) error
UpdateMountStatus updates the mount status of the dataset according to the given phase
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.
func WorkerSidecarEnabled ¶ added in v0.7.0
Types ¶
type UFSPathBuilder ¶ added in v0.6.0
type UFSPathBuilder struct{}
func (UFSPathBuilder) GenAlluxioMountPath ¶ added in v0.6.0
func (u UFSPathBuilder) GenAlluxioMountPath(curMount datav1alpha1.Mount, mounts []datav1alpha1.Mount) string
dataset.spec.mounts mount to alluxio instance strategy:
strategy && priority: 1. if set dataset.spec.mounts[x].path 2. if only one item use default root path "/" 3. "/" + dataset.spec.mounts[x].name
func (UFSPathBuilder) GenAlluxioUFSRootPath ¶ added in v0.6.0
func (u UFSPathBuilder) GenAlluxioUFSRootPath(items []datav1alpha1.Mount) (string, *datav1alpha1.Mount)
value for alluxio instance configuration :
alluxio.master.mount.table.root.ufs
two situations
- mount local storage root path as alluxio root path e.g. : alluxio fs mount /underFSStorage /
- direct mount ufs endpoint as alluxio root path e.g. : alluxio fs mount http://fluid.io/apache/spark/spark-3.0.2 /
func (UFSPathBuilder) GenLocalStoragePath ¶ added in v0.6.0
func (u UFSPathBuilder) GenLocalStoragePath(curMount datav1alpha1.Mount) string
generate local storage path by mount info
func (UFSPathBuilder) GetLocalStorageRootDir ¶ added in v0.6.0
func (u UFSPathBuilder) GetLocalStorageRootDir() string
this value will be the default value for the alluxio configuration:
alluxio.master.mount.table.root.ufs
e.g. :
$ alluxio fs mount /underFSStorage on / (local, capacity=0B, used=-1B, not read-only, not shared, properties={})
type UFSToUpdate ¶ added in v0.6.0
type UFSToUpdate struct {
// contains filtered or unexported fields
}
UFSToUpdate records the mountPath to change in virtual file system of dataset
func NewUFSToUpdate ¶ added in v0.6.0
func NewUFSToUpdate(ds *datav1alpha1.Dataset) *UFSToUpdate
NewUFSToUpdate get UFSToUpdate according the given dataset
func (*UFSToUpdate) AddMountPaths ¶ added in v0.7.0
func (u *UFSToUpdate) AddMountPaths(mountPaths []string)
AddMountPaths add mounted path to ToAdd
func (*UFSToUpdate) AnalyzePathsDelta ¶ added in v0.6.0
func (u *UFSToUpdate) AnalyzePathsDelta() (specMountPaths, mountedMountPaths []string)
AnalyzePathsDelta analyze the ToAdd and ToRemove from the spec and mounted mountPaths of dataset No need for a mount point with Fluid native scheme('local://' and 'pvc://') to be mounted
func (*UFSToUpdate) ShouldUpdate ¶ added in v0.6.0
func (u *UFSToUpdate) ShouldUpdate() bool
ShouldUpdate check if needs to update the mount points according to ToAdd and ToRemove
func (*UFSToUpdate) ToAdd ¶ added in v0.6.0
func (u *UFSToUpdate) ToAdd() []string
ToAdd get the mountPaths to add into virtual file system of dataset
func (*UFSToUpdate) ToRemove ¶ added in v0.6.0
func (u *UFSToUpdate) ToRemove() []string
ToRemove get the mountPaths to remove from virtual file system of dataset
Source Files ¶
- annotations.go
- byte_size.go
- capabilities.go
- charts.go
- common.go
- crtl_utils.go
- databackup.go
- dataload.go
- datamigrate.go
- dataset.go
- dataset_condition.go
- dataset_runtime.go
- env.go
- errors.go
- excluisve.go
- fluid.go
- home.go
- init_user.go
- json.go
- label.go
- map.go
- mount.go
- net.go
- pprof.go
- quantity.go
- random.go
- raw.go
- resources.go
- runtime_checkers.go
- runtime_condition.go
- runtimes.go
- slice.go
- time_tracker.go
- ufs_path_builder.go
- unix.go
- volumes.go
- webhook.go
- yaml.go