jerryshao commented on code in PR #6964: URL: https://github.com/apache/gravitino/pull/6964#discussion_r2046479486
########## clients/client-python/gravitino/filesystem/gvfs_storage_handler.py: ########## @@ -0,0 +1,739 @@ +# 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 importlib +import sys +import time +from abc import ABC, abstractmethod +from enum import Enum +from typing import Optional, Tuple, List, Dict, Any + +from fsspec import AbstractFileSystem +from fsspec.implementations.arrow import ArrowFSWrapper +from fsspec.implementations.local import LocalFileSystem +from fsspec.utils import infer_storage_options + +from gravitino.api.credential.adls_token_credential import ADLSTokenCredential +from gravitino.api.credential.azure_account_key_credential import ( + AzureAccountKeyCredential, +) +from gravitino.api.credential.credential import Credential +from gravitino.api.credential.gcs_token_credential import GCSTokenCredential +from gravitino.api.credential.oss_secret_key_credential import OSSSecretKeyCredential +from gravitino.api.credential.oss_token_credential import OSSTokenCredential +from gravitino.api.credential.s3_secret_key_credential import S3SecretKeyCredential +from gravitino.api.credential.s3_token_credential import S3TokenCredential +from gravitino.exceptions.base import GravitinoRuntimeException +from gravitino.filesystem.gvfs_config import GVFSConfig + +TIME_WITHOUT_EXPIRATION = sys.maxsize +SLASH = "/" + + +class StorageType(Enum): + HDFS = "hdfs" + LOCAL = "file" + GCS = "gs" + S3A = "s3a" + OSS = "oss" + ABS = "abfss" + + +class StorageHandler(ABC): + """A handler class that holds the information about the actual file location and the file system which used in + the GravitinoVirtualFileSystem's operations. + """ + + @abstractmethod + def storage_type(self) -> StorageType: + """Get the storage type. + :return: The storage type + """ + pass Review Comment: Also here. -- 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]
