Esempio n. 1
0
  // String[] sizes: {"1G", "2G", "4G", ...}
  public Map createConfig(String parserConfPath) {
    Map map = SystemParameters.fileToMap(parserConfPath);

    if (!SystemParameters.getBoolean(map, "DIP_ACK_EVERY_TUPLE")) {
      // we don't ack after each tuple is sent,
      //  so we don't need any node to be dedicated for acking
      CLUSTER_ACKERS = 0;
      LOCAL_ACKERS = 0;
    }

    if (SystemParameters.getBoolean(map, "DIP_DISTRIBUTED")) {
      // default value is already set, but for scheduling we might need to change that
      // SystemParameters.putInMap(map, "DIP_NUM_WORKERS", CLUSTER_WORKERS);
      SystemParameters.putInMap(map, "DIP_NUM_ACKERS", CLUSTER_ACKERS);
    } else {
      SystemParameters.putInMap(map, "DIP_NUM_ACKERS", LOCAL_ACKERS);
    }

    String dbSize = SystemParameters.getString(map, "DIP_DB_SIZE") + "G";
    String dataRoot = SystemParameters.getString(map, "DIP_DATA_ROOT");
    String dataPath = dataRoot + "/" + dbSize + "/";

    SystemParameters.putInMap(map, "DIP_DATA_PATH", dataPath);

    return map;
  }