Uploaded image for project: 'Chukwa (retired)'
  1. Chukwa (retired)
  2. CHUKWA-163

source code should not use DATACONF envrionment variable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.1.2
    • 0.1.2
    • User Interface
    • None

    Description

      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);
        }

      Attachments

        1. CHUKWA-163.patch
          2 kB
          Terence Kwan

        Activity

          People

            terencekwan Terence Kwan
            terencekwan Terence Kwan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: