use of org.apache.tez.dag.api.records.DAGProtos.PlanKeyValuePair in project tez by apache.
the class TestTezClientUtils method testConfSerializationForAm.
@Test(timeout = 5000)
public void testConfSerializationForAm() {
Configuration conf = new Configuration(false);
String val1 = "fixedProperty";
String val2 = "parametrizedProperty/${user.name}";
String expVal2 = "parametrizedProperty/" + System.getProperty("user.name");
conf.set("property1", val1);
conf.set("property2", val2);
Map<String, String> expected = new HashMap<String, String>();
expected.put("property1", val1);
expected.put("property2", expVal2);
ConfigurationProto confProto = TezClientUtils.createFinalConfProtoForApp(conf, null);
for (PlanKeyValuePair kvPair : confProto.getConfKeyValuesList()) {
String v = expected.remove(kvPair.getKey());
assertEquals(v, kvPair.getValue());
}
assertTrue(expected.isEmpty());
}
use of org.apache.tez.dag.api.records.DAGProtos.PlanKeyValuePair in project tez by apache.
the class TestTezClientUtils method testConfigurationAllowAll.
@Test(timeout = 5000)
public void testConfigurationAllowAll() {
Configuration srcConf = new Configuration(false);
Map<String, String> confMap = new HashMap<String, String>();
confMap.put("foo.property", "2000");
confMap.put("tez.property", "tezProperty");
confMap.put("yarn.property", "yarnProperty");
for (Map.Entry<String, String> entry : confMap.entrySet()) {
srcConf.set(entry.getKey(), entry.getValue());
}
ConfigurationProto confProto = TezClientUtils.createFinalConfProtoForApp(srcConf, null);
for (PlanKeyValuePair kvPair : confProto.getConfKeyValuesList()) {
String val = confMap.remove(kvPair.getKey());
assertNotNull(val);
assertEquals(val, kvPair.getValue());
}
assertTrue(confMap.isEmpty());
}
use of org.apache.tez.dag.api.records.DAGProtos.PlanKeyValuePair in project tez by apache.
the class DagTypeConverters method convertConfFromProto.
public static Map<String, String> convertConfFromProto(ConfigurationProto confProto) {
List<PlanKeyValuePair> settingList = confProto.getConfKeyValuesList();
Map<String, String> map = new HashMap<String, String>();
for (PlanKeyValuePair setting : settingList) {
map.put(setting.getKey(), setting.getValue());
}
return map;
}
Aggregations