gravitino.filesystem.gvfs_storage_handler.GCSStorageHandler¶
- class gravitino.filesystem.gvfs_storage_handler.GCSStorageHandler¶
Bases:
StorageHandler
GCS Storage Handler
- __init__()¶
Methods
__init__
()actual_info_to_gvfs_info
(entry, ...)Convert a file info from an actual entry to a virtual entry.
actual_path_to_gvfs_path
(actual_path, ...)Convert the actual path to the gvfs path.
get_filesystem
([actual_path])Get the file system.
get_filesystem_with_expiration
(credentials, ...)Get the file system with expiration.
Get the storage type.
strip_storage_protocol
(path)Strip the storage protocol from the path.
- actual_info_to_gvfs_info(entry: Dict, fileset_location: str, gvfs_path_prefix: str)¶
Convert a file info from an actual entry to a virtual entry. :param entry: A dict of the actual file info :param fileset_location: Storage location of the fileset :param gvfs_path_prefix: The prefix of the virtual path :return A dict of the virtual file info
- actual_path_to_gvfs_path(actual_path: str, fileset_location: str, gvfs_path_prefix: str)¶
Convert the actual path to the gvfs path. :param actual_path: The actual path :param fileset_location: The fileset location :param gvfs_path_prefix: The gvfs path prefix :return: The gvfs path
- get_filesystem(actual_path: str | None = None, **kwargs) AbstractFileSystem ¶
Get the file system. :return: The file system
- get_filesystem_with_expiration(credentials: List[Credential], catalog_props: Dict[str, str], options: Dict[str, str], actual_path: str | None = None, **kwargs) Tuple[int, AbstractFileSystem] ¶
Get the file system with expiration. :return: The file system and the expiration time
- storage_type()¶
Get the storage type. :return: The storage type
- strip_storage_protocol(path: str) str ¶
- Strip the storage protocol from the path.
- Before passing the path to the underlying file system for processing,
pre-process the protocol information in the path.
Some file systems require special processing. For HDFS, we can pass the path like ‘hdfs://{host}:{port}/xxx’. For Local, we can pass the path like ‘/tmp/xxx’.
- Parameters:
path – The path
- Returns:
The stripped path