-
Notifications
You must be signed in to change notification settings - Fork 855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dr. Elephant Tez Support working patch #313
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9b9d285
EA Tez Working Commit
9cc5264
Added Apache License
805eb61
Indent Change and License header update
fb6b83c
Tez fetcher variable change
74af5c0
Removed default 100 Limit for Vertex URL task Fetch and code review c…
9bc14bc
Resolving merge conflicts
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
app/com/linkedin/drelephant/tez/TezMetricsAggregator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/* | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
* | ||
*/ | ||
package com.linkedin.drelephant.tez; | ||
|
||
import com.linkedin.drelephant.analysis.*; | ||
import com.linkedin.drelephant.configurations.aggregator.AggregatorConfigurationData; | ||
import com.linkedin.drelephant.tez.data.TezApplicationData; | ||
import org.apache.commons.io.FileUtils; | ||
import org.apache.log4j.Logger; | ||
|
||
/** | ||
* Aggregates task level metrics to application | ||
*/ | ||
|
||
public class TezMetricsAggregator implements HadoopMetricsAggregator { | ||
|
||
private static final Logger logger = Logger.getLogger(TezMetricsAggregator.class); | ||
|
||
private static final String TEZ_CONTAINER_CONFIG = "hive.tez.container.size"; | ||
private static final String MAP_CONTAINER_CONFIG = "mapreduce.map.memory.mb"; | ||
private static final String REDUCER_CONTAINER_CONFIG = "mapreduce.reduce.memory.mb"; | ||
private static final String REDUCER_SLOW_START_CONFIG = "mapreduce.job.reduce.slowstart.completedmaps"; | ||
private static final long CONTAINER_MEMORY_DEFAULT_BYTES = 2048L * FileUtils.ONE_MB; | ||
|
||
private HadoopAggregatedData _hadoopAggregatedData = null; | ||
private TezTaskLevelAggregatedMetrics _mapTasks; | ||
private TezTaskLevelAggregatedMetrics _reduceTasks; | ||
|
||
private AggregatorConfigurationData _aggregatorConfigurationData; | ||
|
||
public TezMetricsAggregator(AggregatorConfigurationData _aggregatorConfigurationData) { | ||
this._aggregatorConfigurationData = _aggregatorConfigurationData; | ||
_hadoopAggregatedData = new HadoopAggregatedData(); | ||
} | ||
|
||
@Override | ||
public void aggregate(HadoopApplicationData hadoopData) { | ||
|
||
TezApplicationData data = (TezApplicationData) hadoopData; | ||
|
||
long mapTaskContainerSize = getMapContainerSize(data); | ||
long reduceTaskContainerSize = getReducerContainerSize(data); | ||
|
||
int reduceTaskSlowStartPercentage = | ||
(int) (Double.parseDouble(data.getConf().getProperty(REDUCER_SLOW_START_CONFIG)) * 100); | ||
|
||
|
||
//overwrite reduceTaskSlowStartPercentage to 100%. TODO: make use of the slow start percent | ||
reduceTaskSlowStartPercentage = 100; | ||
|
||
_mapTasks = new TezTaskLevelAggregatedMetrics(data.getMapTaskData(), mapTaskContainerSize, data.getStartTime()); | ||
|
||
long reduceIdealStartTime = _mapTasks.getNthPercentileFinishTime(reduceTaskSlowStartPercentage); | ||
|
||
// Mappers list is empty | ||
if(reduceIdealStartTime == -1) { | ||
// ideal start time for reducer is infinite since it cannot start | ||
reduceIdealStartTime = Long.MAX_VALUE; | ||
} | ||
|
||
_reduceTasks = new TezTaskLevelAggregatedMetrics(data.getReduceTaskData(), reduceTaskContainerSize, reduceIdealStartTime); | ||
|
||
_hadoopAggregatedData.setResourceUsed(_mapTasks.getResourceUsed() + _reduceTasks.getResourceUsed()); | ||
_hadoopAggregatedData.setTotalDelay(_mapTasks.getDelay() + _reduceTasks.getDelay()); | ||
_hadoopAggregatedData.setResourceWasted(_mapTasks.getResourceWasted() + _reduceTasks.getResourceWasted()); | ||
} | ||
|
||
@Override | ||
public HadoopAggregatedData getResult() { | ||
return _hadoopAggregatedData; | ||
} | ||
|
||
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)); | ||
} 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)); | ||
} catch ( NumberFormatException ex) { | ||
return CONTAINER_MEMORY_DEFAULT_BYTES; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call this dependency in the docs and setup instructions.