storage

package
v0.0.0-...-8ba21cc Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustPath

func AdjustPath(rawURL string, uniqueID string) (string, error)

AdjustPath adjust rawURL, add uniqueId as path suffix, returns a new path. This function supports both local dir or s3 path. It can be used like the following: 1. adjust subtask's `LoaderConfig.Dir`, uniqueID like `.test-mysql01`. 2. add Lightning checkpoint's fileName to rawURL, uniqueID like `/tidb_lightning_checkpoint.pb`.

func CollectDirFiles

func CollectDirFiles(ctx context.Context, dir string, storage bstorage.ExternalStorage) (map[string]struct{}, error)

CollectDirFiles gets files in dir.

func CreateStorage

func CreateStorage(ctx context.Context, path string) (bstorage.ExternalStorage, error)

CreateStorage creates ExternalStore.

func IsLocalDiskPath

func IsLocalDiskPath(rawURL string) bool

IsLocalDiskPath judges if path is local disk path.

func IsNotExistError

func IsNotExistError(err error) bool

func IsS3Path

func IsS3Path(rawURL string) bool

IsS3Path judges if rawURL is s3 path.

func OpenFile

func OpenFile(ctx context.Context, dir, fileName string, storage bstorage.ExternalStorage) (bstorage.ExternalFileReader, error)

func ReadFile

func ReadFile(ctx context.Context, dir, fileName string, storage bstorage.ExternalStorage) ([]byte, error)

func RemoveAll

func RemoveAll(ctx context.Context, dir string, storage bstorage.ExternalStorage) error

RemoveAll remove files in dir.

func TrimPath

func TrimPath(rawURL string, uniqueID string) (string, error)

TrimPath trims rawURL suffix which is uniqueID, supports local and s3.

Types

This section is empty.

Jump to

Keyboard shortcuts

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