def get_default_abfs_fs(): default_fs = core_site.get_default_fs() if default_fs: return default_fs else: return ABFS_CLUSTERS['default'].FS_DEFAULTFS.get()
def get_default_abfs_fs(): default_fs = core_site.get_default_fs() return default_fs if default_fs and default_fs.startswith('abfs://') and \ ABFS_CLUSTERS['default'].ENABLE_DEFAULTFS_FROM_CORESITE.get() else ABFS_CLUSTERS['default'].FS_DEFAULTFS.get()
def get_default_abfs_fs(): default_fs = core_site.get_default_fs() return default_fs if default_fs and default_fs.startwith( 'abfs://') else ABFS_CLUSTERS['default'].FS_DEFAULTFS.get()
def test_core_site(): hadoop_home = tempfile.mkdtemp() finish = [] try: xml = """<?xml version="1.0"?> <configuration> <property> <name>fs.s3a.custom.signers</name> <value>RazS3SignerPlugin:org.apache.ranger.raz.hook.s3.RazS3SignerPlugin:org.apache.ranger.raz.hook.s3.RazS3SignerPluginInitializer</value> </property> <property> <name>fs.s3a.s3.signing-algorithm</name> <value>RazS3SignerPlugin</value> </property> <property> <name>fs.s3a.delegation.token.binding</name> <value>org.apache.ranger.raz.hook.s3.RazDelegationTokenBinding</value> </property> <property> <name>fs.s3a.ext.raz.rest.host.url</name> <value>https://gehue-adls-master:6082/</value> </property> <property> <name>fs.s3a.ext.raz.s3.access.cluster.name</name> <value>gehue-adls</value> </property> <property> <name>fs.s3a.bucket.gethue-dev.endpoint</name> <value>s3.us-west-2.amazonaws.com</value> </property> <property> <name>fs.azure.ext.raz.rest.host.url</name> <value>https://gehue-adls-master:6082/</value> </property> <property> <name>fs.azure.ext.raz.adls.access.cluster.name</name> <value>gehue-adls</value> </property> <property> <name>fs.defaultFS</name> <value>abfs://[email protected]/hue-adls</value> </property> </configuration> """ open_file(os.path.join(hadoop_home, 'core-site.xml'), 'w').write(xml) finish = (conf.HDFS_CLUSTERS.set_for_testing({ 'default': {} }), conf.HDFS_CLUSTERS['default'].HADOOP_CONF_DIR.set_for_testing( hadoop_home)) core_site.reset() assert_equal(core_site.get_raz_api_url(), 'https://*****:*****@gethuedevstorage.dfs.core.windows.net/hue-adls') assert_equal(get_remote_home_storage(), 's3a://gethue-dev') assert_equal(get_region(), 'us-west-2') finally: core_site.reset() for f in finish: f()