Skip to content

Commit

Permalink
Don't error out when nameservice is set
Browse files Browse the repository at this point in the history
  • Loading branch information
alexr-bq committed Feb 4, 2022
1 parent 7fb8ecd commit 72d4307
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,11 @@ class VerticaJdbcLayer(cfg: JDBCConfig) extends JdbcLayerInterface {
authMethod match {
case Some(authMethod) if authMethod == "kerberos" =>
for {
nameNodeAddress <- Option(hadoopConf.get(HdfsClientConfigKeys.DFS_NAMENODE_HTTPS_ADDRESS_KEY))
nameNodeAddressOrNameservice <- Option(hadoopConf.get(HdfsClientConfigKeys.DFS_NAMENODE_HTTPS_ADDRESS_KEY))
.orElse(Option(hadoopConf.get(HdfsClientConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY)))
.orElse(Option(hadoopConf.get(HdfsClientConfigKeys.DFS_NAMESERVICES))) // don't error out here if nameservice is set
.toRight(MissingNameNodeAddressError())
_ = logger.debug("Hadoop impersonation: name node address: " + nameNodeAddress)
_ = logger.debug("Hadoop impersonation: name node address or nameservice: " + nameNodeAddressOrNameservice)
encodedDelegationToken <- fileStoreLayer.getImpersonationToken(cfg.auth.user)
jsonString = Option(hadoopConf.get(HdfsClientConfigKeys.DFS_NAMESERVICES)) match {
case Some(nameservice) => s"""
Expand All @@ -396,7 +397,7 @@ class VerticaJdbcLayer(cfg: JDBCConfig) extends JdbcLayerInterface {

case None => s"""
{
"authority": "$nameNodeAddress",
"authority": "$nameNodeAddressOrNameservice",
"token": "$encodedDelegationToken"
}"""
}
Expand Down

0 comments on commit 72d4307

Please sign in to comment.