Skip to content

Commit

Permalink
Fix wrong metrics for Pig job using TEZ (linkedin#479)
Browse files Browse the repository at this point in the history
* Fix wrong metrics for Pig job using TEZ

* Single return statement
  • Loading branch information
Valdimus authored and mkumar1984 committed Feb 15, 2019
1 parent 4967733 commit f2c43aa
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions app/com/linkedin/drelephant/tez/TezMetricsAggregator.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,19 @@ public HadoopAggregatedData getResult() {

private long getMapContainerSize(HadoopApplicationData data) {
try {
long mapContainerSize = Long.parseLong(data.getConf().getProperty(TEZ_CONTAINER_CONFIG));
if (mapContainerSize > 0)
return mapContainerSize;
else
return Long.parseLong(data.getConf().getProperty(MAP_CONTAINER_CONFIG));
// Trying to get container size from tez config, if not found trying from MapReduce config
long mapContainerSize = data.getConf().containsKey(TEZ_CONTAINER_CONFIG) ? Long.parseLong(data.getConf().getProperty(TEZ_CONTAINER_CONFIG)) : -1;
return mapContainerSize > 0 ? mapContainerSize : Long.parseLong(data.getConf().getProperty(MAP_CONTAINER_CONFIG));
} catch ( NumberFormatException ex) {
return CONTAINER_MEMORY_DEFAULT_BYTES;
}
}

private long getReducerContainerSize(HadoopApplicationData data) {
try {
long reducerContainerSize = Long.parseLong(data.getConf().getProperty(TEZ_CONTAINER_CONFIG));
if (reducerContainerSize > 0)
return reducerContainerSize;
else
return Long.parseLong(data.getConf().getProperty(REDUCER_CONTAINER_CONFIG));
// Trying to get container size from tez config, if not found trying from MapReduce config
long reducerContainerSize = data.getConf().containsKey(TEZ_CONTAINER_CONFIG) ? Long.parseLong(data.getConf().getProperty(TEZ_CONTAINER_CONFIG)) : -1;
return reducerContainerSize > 0 ? reducerContainerSize: Long.parseLong(data.getConf().getProperty(REDUCER_CONTAINER_CONFIG));
} catch ( NumberFormatException ex) {
return CONTAINER_MEMORY_DEFAULT_BYTES;
}
Expand Down

0 comments on commit f2c43aa

Please sign in to comment.