def get_conn(self):
<EOL>effective_user = self.proxy_user<EOL>autoconfig = self.autoconfig<EOL>use_sasl = configuration.conf.get('<STR_LIT>', '<STR_LIT>') == '<STR_LIT>'<EOL>try:<EOL><INDENT>connections = self.get_connections(self.hdfs_conn_id)<EOL>if not effective_user:<EOL><INDENT>effective_user = connections[<NUM_LIT:0>].login<EOL><DEDENT>if not autoconfig:<EOL><INDENT>autoconfig = connections[<NUM_LIT:0>].extra_dejson.get('<STR_LIT>',<EOL>False)<EOL><DEDENT>hdfs_namenode_principal = connections[<NUM_LIT:0>].extra_dejson.get(<EOL>'<STR_LIT>')<EOL><DEDENT>except AirflowException:<EOL><INDENT>if not autoconfig:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>if autoconfig:<EOL><INDENT>client = AutoConfigClient(effective_user=effective_user,<EOL>use_sasl=use_sasl)<EOL><DEDENT>elif len(connections) == <NUM_LIT:1>:<EOL><INDENT>client = Client(connections[<NUM_LIT:0>].host, connections[<NUM_LIT:0>].port,<EOL>effective_user=effective_user, use_sasl=use_sasl,<EOL>hdfs_namenode_principal=hdfs_namenode_principal)<EOL><DEDENT>elif len(connections) > <NUM_LIT:1>:<EOL><INDENT>nn = [Namenode(conn.host, conn.port) for conn in connections]<EOL>client = HAClient(nn, effective_user=effective_user,<EOL>use_sasl=use_sasl,<EOL>hdfs_namenode_principal=hdfs_namenode_principal)<EOL><DEDENT>else:<EOL><INDENT>raise HDFSHookException("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>return client<EOL>
Returns a snakebite HDFSClient object.