Browse Source

[raz] Auto detect cluster name from config file

Romain Rigaux 4 years ago
parent
commit
6c8cf19c6e
1 changed files with 11 additions and 0 deletions
  1. 11 0
      desktop/libs/hadoop/src/hadoop/core_site.py

+ 11 - 0
desktop/libs/hadoop/src/hadoop/core_site.py

@@ -43,6 +43,7 @@ _CNF_S3A_SECRET_KEY = 'fs.s3a.secret.key'
 _CNF_S3A_SESSION_TOKEN = 'fs.s3a.session.token'
 
 _CNF_S3A_RAZ_API_URL = 'fs.s3a.ext.raz.rest.host.url'
+_CNF_S3A_RAZ_CLUSTER_NAME = 'fs.s3a.ext.raz.s3.access.cluster.name'
 
 _CNF_ADLS_CLIENT_ID = 'dfs.adls.oauth2.client.id'
 _CNF_ADLS_AUTHENTICATION_CODE = 'dfs.adls.oauth2.credential'
@@ -113,6 +114,7 @@ def get_s3a_secret_key():
 def get_s3a_session_token():
   return get_conf().get(_CNF_S3A_SESSION_TOKEN)
 
+
 def get_raz_api_url():
   """
   Get Raz API.
@@ -121,6 +123,15 @@ def get_raz_api_url():
   """
   return get_conf().get(_CNF_S3A_RAZ_API_URL, 'https://localhost:8080')
 
+def get_raz_cluster_name():
+  """
+  Get the name of the Cluster where Raz is running.
+
+  S3 only. Add check for Azure when supported.
+  """
+  return get_conf().get(_CNF_S3A_RAZ_CLUSTER_NAME, '')
+
+
 def get_adls_client_id():
   """
   Get ADLS client id