chukwa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terence Kwan (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CHUKWA-163) source code should not use DATACONF envrionment variable
Date Mon, 20 Apr 2009 21:24:47 GMT

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

Terence Kwan updated CHUKWA-163:
--------------------------------

    Attachment: CHUKWA-163.patch

> source code should not use DATACONF envrionment variable
> --------------------------------------------------------
>
>                 Key: CHUKWA-163
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-163
>             Project: Hadoop Chukwa
>          Issue Type: Bug
>          Components: User Interface
>    Affects Versions: 0.1.2
>            Reporter: Terence Kwan
>            Assignee: Terence Kwan
>             Fix For: 0.1.2
>
>         Attachments: CHUKWA-163.patch
>
>
> DataConfig.java and DatabaseConfig.java should not use DATACONFIG environment variable.
It should use CHUKWA_CONF_DIR.
> Index: src/java/org/apache/hadoop/chukwa/inputtools/mdl/DataConfig.java
> ===================================================================
> --- src/java/org/apache/hadoop/chukwa/inputtools/mdl/DataConfig.java	(revision 766193)
> +++ src/java/org/apache/hadoop/chukwa/inputtools/mdl/DataConfig.java	(working copy)
> @@ -26,10 +26,11 @@
>  import java.util.Iterator;
>  import java.util.HashMap;
>  import java.util.Map;
> +import java.io.File;
>  
>  public class DataConfig {
>    private static Configuration config;
> -  final static String DATACONFIG = "mdl.xml";
> +  final static String MDL_XML = "mdl.xml";
>    private Log log = LogFactory.getLog(DataConfig.class);
>  
>    public DataConfig(String path) {
> @@ -39,9 +40,11 @@
>    }
>  
>    public DataConfig() {
> -    String dataConfig = System.getenv("DATACONFIG");
> +    String dataConfig = System.getenv("CHUKWA_CONF_DIR");
>      if (dataConfig == null) {
> -      dataConfig = DATACONFIG;
> +      dataConfig = MDL_XML;
> +    } else {
> +      dataConfig += File.separator + MDL_XML;
>      }
>      log.debug("DATACONFIG=" + dataConfig);
>      if (config == null) {
> Index: src/java/org/apache/hadoop/chukwa/database/DatabaseConfig.java
> ===================================================================
> --- src/java/org/apache/hadoop/chukwa/database/DatabaseConfig.java	(revision 766193)
> +++ src/java/org/apache/hadoop/chukwa/database/DatabaseConfig.java	(working copy)
> @@ -22,6 +22,7 @@
>  import org.apache.hadoop.conf.Configuration;
>  import org.apache.hadoop.fs.Path;
>  import java.util.*;
> +import java.io.File;
>  
>  public class DatabaseConfig {
>    private Configuration config = null;
> @@ -32,6 +33,7 @@
>    public final static long MONTH = 30 * 24 * 60 * 60 * 1000L;
>    public final static long WEEK = 7 * 24 * 60 * 60 * 1000L;
>    public final static long DAY = 24 * 60 * 60 * 1000L;
> +  public final static String MDL_XML = "mdl.xml";
>  
>    public DatabaseConfig(String path) {
>      Path fileResource = new Path(path);
> @@ -40,7 +42,13 @@
>    }
>  
>    public DatabaseConfig() {
> -    Path fileResource = new Path(System.getenv("DATACONFIG"));
> +    String dataConfig = System.getenv("CHUKWA_CONF_DIR");
> +    if (dataConfig == null) {
> +      dataConfig = MDL_XML;
> +    } else {
> +      dataConfig += File.separator + MDL_XML;
> +    }
> +    Path fileResource = new Path(dataConfig);
>      config = new Configuration();
>      config.addResource(fileResource);
>    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message