public void setProperties()

in datafu-hourglass/src/main/java/datafu/hourglass/jobs/AbstractJob.java [157:232]


  public void setProperties(Properties props)
  {
    _props = props;
    updateConfigurationFromProps(_props);

    if (_props.get("input.path") != null)
    {
      String[] pathSplit = ((String)_props.get("input.path")).split(",");
      List<Path> paths = new ArrayList<Path>();
      for (String path : pathSplit)
      {
        if (path != null && path.length() > 0)
        {
          path = path.trim();
          if (path.length() > 0)
          {
            paths.add(new Path(path));
          }
        }
      }
      if (paths.size() > 0)
      {
        setInputPaths(paths);
      }
      else
      {
        throw new RuntimeException("Could not extract input paths from: " + _props.get("input.path"));
      }
    }
    else
    {
      List<Path> inputPaths = new ArrayList<Path>();
      for (Object o : _props.keySet())
      {
        String prop = o.toString();
        if (prop.startsWith("input.path."))
        {
          inputPaths.add(new Path(_props.getProperty(prop)));
        }
      }
      if (inputPaths.size() > 0)
      {
        setInputPaths(inputPaths);
      }
    }

    if (_props.get("output.path") != null)
    {
      setOutputPath(new Path((String)_props.get("output.path")));
    }

    if (_props.get("temp.path") != null)
    {
      setTempPath(new Path((String)_props.get("temp.path")));
    }

    if (_props.get("retention.count") != null)
    {
      setRetentionCount(Integer.parseInt((String)_props.get("retention.count")));
    }

    if (_props.get("num.reducers") != null)
    {
      setNumReducers(Integer.parseInt((String)_props.get("num.reducers")));
    }

    if (_props.get("use.combiner") != null)
    {
      setUseCombiner(Boolean.parseBoolean((String)_props.get("use.combiner")));
    }

    if (_props.get("counters.path") != null)
    {
      setCountersParentPath(new Path((String)_props.get("counters.path")));
    }
  }