File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,21 @@ func (e *AlluxioEngine) queryCacheStatus() (states cacheStates, err error) {
6363
6464}
6565
66+ // PatchDatasetStatus updates the Dataset status with cached percentage based on the provided cache states.
67+ // It skips updating under the following conditions:
68+ // - When the Dataset's UfsTotal field is empty
69+ // - When the Dataset's UfsTotal field contains the metadata sync pending message
70+ // The cached percentage is calculated as (cached bytes / UfsTotal bytes) * 100.
71+ //
72+ // Parameters:
73+ // - dataset (v1alpha1.Dataset): Pointer to the Dataset object containing UFS metadata.
74+ // The Status.UfsTotal field must be a valid human-readable size string (e.g. "10GiB")
75+ // - states (cacheStates): Pointer to the cache state structure that will be modified in-place.
76+ // The cached field must be a valid human-readable size string (e.g. "5GiB")
77+ //
78+ // Returns:
79+ // - None: Modifies the states.cachedPercentage field directly with formatted percentage string.
80+ // The percentage is stored as a string using cachedPercentageFormat (e.g. "45.60%")
6681func (e AlluxioEngine ) patchDatasetStatus (dataset * v1alpha1.Dataset , states * cacheStates ) {
6782 // skip when `dataset.Status.UfsTotal` is empty
6883 if dataset .Status .UfsTotal == "" {
You can’t perform that action at this time.
0 commit comments