|
@@ -63,6 +63,7 @@ import org.apache.hadoop.yarn.api.records.ReservationId;
|
|
import org.codehaus.jackson.JsonParseException;
|
|
import org.codehaus.jackson.JsonParseException;
|
|
import org.codehaus.jackson.map.JsonMappingException;
|
|
import org.codehaus.jackson.map.JsonMappingException;
|
|
import org.codehaus.jackson.map.ObjectMapper;
|
|
import org.codehaus.jackson.map.ObjectMapper;
|
|
|
|
+import org.codehaus.jackson.map.ObjectReader;
|
|
|
|
|
|
import com.google.common.base.Charsets;
|
|
import com.google.common.base.Charsets;
|
|
|
|
|
|
@@ -70,6 +71,8 @@ import com.google.common.base.Charsets;
|
|
@InterfaceStability.Unstable
|
|
@InterfaceStability.Unstable
|
|
class JobSubmitter {
|
|
class JobSubmitter {
|
|
protected static final Log LOG = LogFactory.getLog(JobSubmitter.class);
|
|
protected static final Log LOG = LogFactory.getLog(JobSubmitter.class);
|
|
|
|
+ private static final ObjectReader READER =
|
|
|
|
+ new ObjectMapper().reader(Map.class);
|
|
private static final String SHUFFLE_KEYGEN_ALGORITHM = "HmacSHA1";
|
|
private static final String SHUFFLE_KEYGEN_ALGORITHM = "HmacSHA1";
|
|
private static final int SHUFFLE_KEY_LENGTH = 64;
|
|
private static final int SHUFFLE_KEY_LENGTH = 64;
|
|
private FileSystem jtFs;
|
|
private FileSystem jtFs;
|
|
@@ -396,9 +399,7 @@ class JobSubmitter {
|
|
boolean json_error = false;
|
|
boolean json_error = false;
|
|
try {
|
|
try {
|
|
// read JSON
|
|
// read JSON
|
|
- ObjectMapper mapper = new ObjectMapper();
|
|
|
|
- Map<String, String> nm =
|
|
|
|
- mapper.readValue(new File(localFileName), Map.class);
|
|
|
|
|
|
+ Map<String, String> nm = READER.readValue(new File(localFileName));
|
|
|
|
|
|
for(Map.Entry<String, String> ent: nm.entrySet()) {
|
|
for(Map.Entry<String, String> ent: nm.entrySet()) {
|
|
credentials.addSecretKey(new Text(ent.getKey()), ent.getValue()
|
|
credentials.addSecretKey(new Text(ent.getKey()), ent.getValue()
|