public abstract class YarnClientUtils extends Object
| Modifier and Type | Field and Description | 
|---|---|
| static String | NO_LABEL_ERR_MSG | 
| Constructor and Description | 
|---|
| YarnClientUtils() | 
| Modifier and Type | Method and Description | 
|---|---|
| static List<org.apache.hadoop.yarn.api.records.NodeLabel> | buildNodeLabelsFromStr(String args)Creates node labels from string | 
| static String | generateToken(String server)Generate SPNEGO challenge request token. | 
| static String | getRmPrincipal(org.apache.hadoop.conf.Configuration conf)Look up and return the resource manager's principal. | 
| static String | getRmPrincipal(String rmPrincipal,
              org.apache.hadoop.conf.Configuration conf)Perform the  _HOSTreplacement in theprincipal,
 Returning the result. | 
public static final String NO_LABEL_ERR_MSG
public static String getRmPrincipal(org.apache.hadoop.conf.Configuration conf) throws IOException
_HOST replacement in the principal and
 correctly handles HA resource manager configurations.conf - the Configuration file from which to read the
 principalYarnConfiguration.RM_PRINCIPAL property is not set in the
 conf parameterIOException - thrown if there's an error replacing the host namepublic static String getRmPrincipal(String rmPrincipal, org.apache.hadoop.conf.Configuration conf) throws IOException
_HOST replacement in the principal,
 Returning the result. Correctly handles HA resource manager configurations.rmPrincipal - the principal string to prepareconf - the configurationIOException - thrown if there's an error replacing the host namepublic static List<org.apache.hadoop.yarn.api.records.NodeLabel> buildNodeLabelsFromStr(String args)
args - nodelabels string to be parsedpublic static String generateToken(String server) throws IOException, InterruptedException
server - - hostname to contactIOException - thrown if doAs failedInterruptedException - thrown if doAs is interruptedCopyright © 2008–2023 Apache Software Foundation. All rights reserved.