File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ type ClientOptions struct {
5757	// Addresses specifies the namenode(s) to connect to. 
5858	Addresses  []string 
5959	// User specifies which HDFS user the client will act as. It is required 
60- 	// unless kerberos authentication is enabled, in which case it will be  
61- 	// determined from  the provided credentials if empty . 
60+ 	// unless kerberos authentication is enabled, in which case it is overridden  
61+ 	// by  the username set in KerberosClient . 
6262	User  string 
6363	// UseDatanodeHostname specifies whether the client should connect to the 
6464	// datanodes via hostname (which is useful in multi-homed setups) or IP 
Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ type NamenodeConnectionOptions struct {
5858	// Addresses specifies the namenode(s) to connect to. 
5959	Addresses  []string 
6060	// User specifies which HDFS user the client will act as. It is required 
61- 	// unless kerberos authentication is enabled, in which case it will be  
62- 	// determined from  the provided credentials if empty . 
61+ 	// unless kerberos authentication is enabled, in which case it is overridden  
62+ 	// by  the username set in KerberosClient . 
6363	User  string 
6464	// DialFunc is used to connect to the namenodes. If nil, then 
6565	// (&net.Dialer{}).DialContext is used. 
@@ -94,14 +94,12 @@ func NewNamenodeConnection(options NamenodeConnectionOptions) (*NamenodeConnecti
9494
9595	var  user , realm  string 
9696	user  =  options .User 
97- 	if  user  ==  ""  {
98- 		if  options .KerberosClient  !=  nil  {
99- 			creds  :=  options .KerberosClient .Credentials 
100- 			user  =  creds .UserName ()
101- 			realm  =  creds .Realm ()
102- 		} else  {
103- 			return  nil , errors .New ("user not specified" )
104- 		}
97+ 	if  options .KerberosClient  !=  nil  {
98+ 		creds  :=  options .KerberosClient .Credentials 
99+ 		user  =  creds .UserName ()
100+ 		realm  =  creds .Realm ()
101+ 	} else  if  user  ==  ""  {
102+ 		return  nil , errors .New ("user not specified" )
105103	}
106104
107105	// The ClientID is reused here both in the RPC headers (which requires a 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments