mchades commented on code in PR #6964: URL: https://github.com/apache/gravitino/pull/6964#discussion_r2046495884
########## clients/client-python/gravitino/filesystem/gvfs_base_operations.py: ########## @@ -0,0 +1,497 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import logging +import os +import sys +import time +from abc import ABC, abstractmethod +from pathlib import PurePosixPath +from typing import Dict, Tuple + +from cachetools import TTLCache, LRUCache +from fsspec import AbstractFileSystem +from readerwriterlock import rwlock + +from gravitino.api.catalog import Catalog +from gravitino.audit.caller_context import CallerContextHolder, CallerContext +from gravitino.audit.fileset_audit_constants import FilesetAuditConstants +from gravitino.audit.fileset_data_operation import FilesetDataOperation +from gravitino.audit.internal_client_type import InternalClientType +from gravitino.client.fileset_catalog import FilesetCatalog +from gravitino.client.generic_fileset import GenericFileset +from gravitino.exceptions.base import ( + GravitinoRuntimeException, + NoSuchLocationNameException, +) +from gravitino.filesystem.gvfs_config import GVFSConfig +from gravitino.filesystem.gvfs_storage_handler import get_storage_handler_by_path +from gravitino.filesystem.gvfs_utils import ( + get_sub_path_from_virtual_path, + extract_identifier, + create_client, +) +from gravitino.name_identifier import NameIdentifier + +logger = logging.getLogger(__name__) + +PROTOCOL_NAME = "gvfs" + +TIME_WITHOUT_EXPIRATION = sys.maxsize + + +class FilesetPathNotFoundError(FileNotFoundError): + """Exception raised when the catalog, schema or fileset is not found in the GVFS path.""" + + +class BaseGVFSOperations(ABC): + """ + Abstract base class for Gravitino Virtual File System operations. + + This class provides the core functionality for interacting with the Gravitino Virtual File + System, including operations for file manipulation, directory management, and credential + handling. It handles the mapping between virtual paths in the Gravitino namespace and actual file + paths in underlying storage systems. + + Implementations of this class should provide the specific behaviors for each file system + operation. + """ + + # pylint: disable=too-many-instance-attributes + + SLASH = "/" + + ENABLE_CREDENTIAL_VENDING_DEFAULT = False Review Comment: Sorry, missing to remove -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
