@@ -18,18 +18,19 @@ def __init__(self, hdfs_url: str = None,
1818 hdfs_home : str = None ,
1919 enable_krb5_auth : bool = False ,
2020 hdfs_auth_principal : str = None ,
21- hdfs_auth_secret_file_path : str = None ):
21+ hdfs_auth_password : str = None ,
22+ hdfs_hostname_override : str = None ):
2223 self .hdfs_url = hdfs_url
2324 self .hdfs_user = hdfs_user
2425 self .hdfs_home = hdfs_home
2526 self .enable_krb5_auth = enable_krb5_auth
2627 self .hdfs_auth_principal = hdfs_auth_principal
27- self .hdfs_auth_secret_file_path = hdfs_auth_secret_file_path
28+ self .hdfs_auth_password = hdfs_auth_password
29+ self .hdfs_hostname_override = hdfs_hostname_override
2830
2931 def __repr__ (self ):
3032 return f"hdfs_user: { self .hdfs_user } , hdfs_home: { self .hdfs_home } , hdfs_url: { self .hdfs_url } , " \
31- f"enable_krb5_auth: { self .enable_krb5_auth } , hdfs_auth_principal: { self .hdfs_auth_principal } , " \
32- f"hdfs_auth_secret_file_path: { self .hdfs_auth_secret_file_path } "
33+ f"enable_krb5_auth: { self .enable_krb5_auth } , hdfs_auth_principal: { self .hdfs_auth_principal } "
3334
3435 def load_config (self , config : dict , logger ):
3536 self .hdfs_url = common_func .get_config_value (
@@ -38,6 +39,7 @@ def load_config(self, config: dict, logger):
3839 'HDFS_USER' , self .DEFAULT_HDFS_USER , config , False )
3940 self .hdfs_home = common_func .get_config_value (
4041 "HDFS_HOME" , os .path .join (self .DEFAULT_HDFS_USER_PATH , self .hdfs_user ), config , False )
42+
4143 # the auth information
4244 self .enable_krb5_auth = common_func .get_config_value (
4345 "HDFS_ENABLE_AUTH" , False , config , False )
@@ -48,14 +50,22 @@ def load_config(self, config: dict, logger):
4850 self .hdfs_auth_principal = common_func .get_config_value (
4951 "HDFS_AUTH_PRINCIPAL" , None , config , require_auth_info
5052 )
51- # the keytab file path
52- self .hdfs_auth_secret_file_path = common_func .get_config_value (
53- "HDFS_AUTH_KEYTAB_PATH" , None , config , require_auth_info
54- )
53+ # the password
54+ self .hdfs_auth_password = common_func .get_config_value (
55+ "HDFS_AUTH_PASSWORD" , None , config , require_auth_info )
56+ # the hostname override
57+ self .hdfs_hostname_override = common_func .get_config_value (
58+ "HDFS_HOSTNAME_OVERRIDE" , None , config , require_auth_info )
5559 if logger is not None :
5660 logger .info (f"*** load hdfs storage config : { self } " )
5761 else :
5862 print (f"*** load hdfs storage config : { self } " )
63+ self ._check ()
64+
65+ def _check (self ):
66+ common_func .require_non_empty ("HDFS_URL" , self .hdfs_url )
67+ common_func .require_non_empty ("HDFS_USER" , self .hdfs_user )
68+ common_func .require_non_empty ("HDFS_HOME" , self .hdfs_home )
5969
6070
6171class StorageApi (ABC ):
0 commit comments