[ 
https://issues.apache.org/jira/browse/FLINK-13130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Charles Xu updated FLINK-13130:
-------------------------------
    Description: 
There are two places checks variables HADOO_CONF_DIR or YARN_CONF_DIR. It's 
better to extract a method and call it separately. 
{code:java}
// check if required Hadoop environment variables are set. If not, warn user
private void checkEnvironmentVariables() {
    if (System.getenv("HADOOP_CONF_DIR") == null &&
        System.getenv("YARN_CONF_DIR") == null) {
            LOG.warn("Neither the HADOOP_CONF_DIR nor the YARN_CONF_DIR 
environment variable is set. " +
                "The Flink YARN Client needs one of these to be set to properly 
load the Hadoop " +
                "configuration for accessing YARN.");
    }
}
{code}
 

  was:
There are two places checks variables HADOO_CONF_DIR or YARN_CONF_DIR. It's 
better to extract a method and call it twice. 
{code:java}
// check if required Hadoop environment variables are set. If not, warn user
private void checkEnvironmentVariables() {
    if (System.getenv("HADOOP_CONF_DIR") == null &&
        System.getenv("YARN_CONF_DIR") == null) {
            LOG.warn("Neither the HADOOP_CONF_DIR nor the YARN_CONF_DIR 
environment variable is set. " +
                "The Flink YARN Client needs one of these to be set to properly 
load the Hadoop " +
                "configuration for accessing YARN.");
    }
}
{code}
 


> Refactor AbstractYarnClusterDescriptor to reduce code duplication
> -----------------------------------------------------------------
>
>                 Key: FLINK-13130
>                 URL: https://issues.apache.org/jira/browse/FLINK-13130
>             Project: Flink
>          Issue Type: Improvement
>          Components: Deployment / YARN
>    Affects Versions: 1.8.0, 1.8.1
>            Reporter: Charles Xu
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> There are two places checks variables HADOO_CONF_DIR or YARN_CONF_DIR. It's 
> better to extract a method and call it separately. 
> {code:java}
> // check if required Hadoop environment variables are set. If not, warn user
> private void checkEnvironmentVariables() {
>     if (System.getenv("HADOOP_CONF_DIR") == null &&
>         System.getenv("YARN_CONF_DIR") == null) {
>             LOG.warn("Neither the HADOOP_CONF_DIR nor the YARN_CONF_DIR 
> environment variable is set. " +
>                 "The Flink YARN Client needs one of these to be set to 
> properly load the Hadoop " +
>                 "configuration for accessing YARN.");
>     }
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to