operations

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GooseFSFileUtils

type GooseFSFileUtils struct {
	// contains filtered or unexported fields
}

func NewGooseFSFileUtils

func NewGooseFSFileUtils(podName string, containerName string, namespace string, log logr.Logger) GooseFSFileUtils

func (GooseFSFileUtils) CachedState

func (a GooseFSFileUtils) CachedState() (cached int64, err error)

func (GooseFSFileUtils) CleanCache

func (a GooseFSFileUtils) CleanCache(path string) (err error)

clean cache with a preset timeout of 60s

func (GooseFSFileUtils) Count

func (a GooseFSFileUtils) Count(goosefsPath string) (fileCount int64, folderCount int64, total int64, err error)

The count of the GooseFS Filesystem

func (GooseFSFileUtils) Du

func (a GooseFSFileUtils) Du(goosefsPath string) (ufs int64, cached int64, cachedPercentage string, err error)

func (GooseFSFileUtils) GetConf

func (a GooseFSFileUtils) GetConf(key string) (value string, err error)

Get Conf info of the GooseFS Engine

func (GooseFSFileUtils) GetFileCount

func (a GooseFSFileUtils) GetFileCount() (fileCount int64, err error)

file count of the GooseFS Filesystem (except folder) use "goosefs fsadmin report metrics" for better performance

func (GooseFSFileUtils) IsExist

func (a GooseFSFileUtils) IsExist(goosefsPath string) (found bool, err error)

IsExist checks if the goosefsPath exists

func (GooseFSFileUtils) IsMounted

func (a GooseFSFileUtils) IsMounted(goosefsPath string) (mounted bool, err error)

func (GooseFSFileUtils) LoadMetaData

func (a GooseFSFileUtils) LoadMetaData(goosefsPath string, sync bool) (err error)

LoadMetaData loads the metadata.

func (GooseFSFileUtils) LoadMetadataWithoutTimeout

func (a GooseFSFileUtils) LoadMetadataWithoutTimeout(goosefsPath string) (err error)

Load the metadata without timeout

func (GooseFSFileUtils) MasterPodName

func (a GooseFSFileUtils) MasterPodName() (masterPodName string, err error)

func (GooseFSFileUtils) Mkdir

func (a GooseFSFileUtils) Mkdir(goosefsPath string) (err error)

func (GooseFSFileUtils) Mount

func (a GooseFSFileUtils) Mount(goosefsPath string,
	ufsPath string,
	options map[string]string,
	readOnly bool,
	shared bool) (err error)

func (GooseFSFileUtils) QueryMetaDataInfoIntoFile

func (a GooseFSFileUtils) QueryMetaDataInfoIntoFile(key KeyOfMetaDataFile, filename string) (value string, err error)

QueryMetadataInfoFile query the metadata info file.

func (GooseFSFileUtils) Ready

func (a GooseFSFileUtils) Ready() (ready bool)

Check if the GooseFS is ready by running `goosefs fsadmin report` command

func (GooseFSFileUtils) ReportCapacity

func (a GooseFSFileUtils) ReportCapacity() (report string, err error)

ReportCapacity get goosefs capacity info by running `goosefs fsadmin report capacity` command

func (GooseFSFileUtils) ReportMetrics

func (a GooseFSFileUtils) ReportMetrics() (metrics string, err error)

ReportMetrics get goosefs metrics by running `goosefs fsadmin report metrics` command

func (GooseFSFileUtils) ReportSummary

func (a GooseFSFileUtils) ReportSummary() (summary string, err error)

Get summary info of the GooseFS Engine

func (GooseFSFileUtils) SyncLocalDir

func (a GooseFSFileUtils) SyncLocalDir(path string) (err error)

SyncLocalDir syncs local path by running command `du -sh <path>`. Under the circumstance where some NAS(e.g. NFS) is mounted on the `<path>`, the function will sync metadata of all files in the NAS. This is necessary for GooseFS to get consistent file metadata with UFS(i.e. NAS in this case).

func (GooseFSFileUtils) UnMount added in v0.7.0

func (a GooseFSFileUtils) UnMount(goosefsPath string) (err error)

UnMount execute command `goosefs fs umount $path` to unmount mountpoint

type KeyOfMetaDataFile

type KeyOfMetaDataFile string
var (
	DatasetName KeyOfMetaDataFile = "dataset"
	Namespace   KeyOfMetaDataFile = "namespace"
	UfsTotal    KeyOfMetaDataFile = "ufstotal"
	FileNum     KeyOfMetaDataFile = "filenum"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL