def is_enabled(fs=None): if fs == 'hdfs': return has_hdfs_enabled() elif fs == 'adl': return is_adls_enabled() elif fs == 's3a': return is_s3_enabled() elif fs == 'abfs': return is_abfs_enabled()
import azure.client from aws.conf import is_enabled as is_s3_enabled from azure.conf import is_adls_enabled, is_abfs_enabled from hadoop.cluster import get_hdfs from hadoop.conf import has_hdfs_enabled from desktop.lib.fs import ProxyFS FS_CACHE = {} DEFAULT_SCHEMA = None FS_GETTERS = {} if has_hdfs_enabled(): FS_GETTERS['hdfs'] = get_hdfs DEFAULT_SCHEMA = 'hdfs' if is_s3_enabled(): FS_GETTERS['s3a'] = aws.get_s3fs if DEFAULT_SCHEMA is None: DEFAULT_SCHEMA = 's3a' if is_adls_enabled(): FS_GETTERS['adl'] = azure.client.get_client if DEFAULT_SCHEMA is None: DEFAULT_SCHEMA = 'adl' if is_abfs_enabled(): FS_GETTERS['abfs'] = azure.client.get_client_abfs if DEFAULT_SCHEMA is None: DEFAULT_SCHEMA = 'abfs'