org.khaleesi.carfield.tools.sparkjobserver.api.SparkJobConfig Maven / Gradle / Ivy
Show all versions of spark-job-server-client Show documentation
package org.khaleesi.carfield.tools.sparkjobserver.api;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
/**
* Presents the information of spark job configuration, when
* calling GET /jobs/<jobId>/config
to a
* spark job server.
*
*
* The application used this SparkJobConfig
instance
* should use the getConfigs()
and parse the values
* itself.
*
* @author bluebreezecf
* @since 2014-09-11
*
*/
public class SparkJobConfig {
private Map configs = new HashMap();
void putConfigItem(String key, Object value) {
this.configs.put(key, value);
}
/**
* Gets all the configuration items.
*
* @return a map holding the key-value pairs of configuration items
*/
public Map getConfigs() {
return new HashMap(this.configs);
}
/**
* {@inheritDoc}
*/
@Override
public String toString() {
StringBuffer buff = new StringBuffer("SparkJobConfig\n{\n");
Set> items = configs.entrySet();
for (Entry item : items) {
buff.append(" ").append(item.getKey()).append(": ")
.append(item.getValue().toString()).append("\n");
}
buff.append("}");
return buff.toString();
}
}