Documentation ¶
Index ¶
- func AdjustPath(rawURL string, uniqueID string) (string, error)
- func CollectDirFiles(ctx context.Context, dir string, storage bstorage.ExternalStorage) (map[string]struct{}, error)
- func CreateStorage(ctx context.Context, path string) (bstorage.ExternalStorage, error)
- func IsLocalDiskPath(rawURL string) bool
- func IsNotExistError(err error) bool
- func IsS3Path(rawURL string) bool
- func OpenFile(ctx context.Context, dir, fileName string, storage bstorage.ExternalStorage) (bstorage.ExternalFileReader, error)
- func ReadFile(ctx context.Context, dir, fileName string, storage bstorage.ExternalStorage) ([]byte, error)
- func RemoveAll(ctx context.Context, dir string, storage bstorage.ExternalStorage) error
- func TrimPath(rawURL string, uniqueID string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdjustPath ¶
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 ¶
CreateStorage creates ExternalStore.
func IsLocalDiskPath ¶
IsLocalDiskPath judges if path is local disk path.
func IsNotExistError ¶
func OpenFile ¶
func OpenFile(ctx context.Context, dir, fileName string, storage bstorage.ExternalStorage) (bstorage.ExternalFileReader, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.