public static Map<String, String> parseCsKeyValue(String str) {
    Map<String, String> properties = new HashMap<String, String>();
    String[] tokens = null;
    if (str != null) {
      tokens = str.trim().split(",");
    }
    for (String token : tokens) {
      if (!token.isEmpty()) {
        String[] parts = token.split("=", 2);
        if (parts.length == 2) {
          properties.put(parts[0], parts[1]);
        }
      }
    }
    return properties;
  }
Parse a comma separated string of key-value pairs into a {property -> value} Map.
e.g. string format: "foo1=bar1,foo2=bar2,foo3=bar3..."

@param str The comma separated, key-value pair string to parse
@return A map of properties
app/com/linkedin/drelephant/util/Utils.java