[
https://issues.apache.org/jira/browse/MAPREDUCE-5873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14169853#comment-14169853
]
Jason Lowe commented on MAPREDUCE-5873:
---------------------------------------
Thanks for updating the patch, Siqi. It's looking better, just a few last nits.
bq. We should provide a sizing hint to the ArrayList constructor during
computeTotalCopyMills since we know worst-case how big it should be
(intervals.size()+1) and we can avoid reallocation/copy during add.
This comment wasn't really addressed. The new patch now requires the
CopyTimeTracker to take a size argument, but it still ends up reallocating the
arraylists needlessly. Note that the size argument is only used to size the
initial value of {{intervals}}, but this array will never be updated. It's
effectively read-only and doesn't need the extra space. The only time we
modify {{intervals}} is when we reassign it to a newly constructed array list
in the getTotalCopyMillis method, and that method builds the new array list
with no size hint. Instead of requiring users to pass the total copies to
CopyTimeTracker, it'd be better to have {{intervals}} initialize to an empty
array (Collections.emptyList would be appropriate here since it's always
read-only) and have the getTotalCopyMillis method size the {{result}} array to
be the size of the original array + 1 (i.e.: the worst-case new size of the
array).
When getTotalCopyMillis is handed a null interval we don't need to recompute
the time and can just return copyMillis. That precludes the need to factor out
the getMillis method which is confusing in light of the similarly-named
getCopyMillis.
The following hunk in the patch is using tabs instead of spaces on the
endMillis line:
{code}
@@ -180,7 +183,8 @@ static URI getBaseURI(TaskAttemptID reduceId, String url) {
public synchronized void copySucceeded(TaskAttemptID mapId,
MapHost host,
long bytes,
- long millis,
+ long startMillis,
+ long endMillis,
MapOutput<K,V> output
) throws IOException {
failureCounts.remove(mapId);
{code}
> Measure bw of a single copy call and display the correct aggregated bw
> ----------------------------------------------------------------------
>
> Key: MAPREDUCE-5873
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-5873
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Affects Versions: 2.3.0
> Reporter: Siqi Li
> Assignee: Siqi Li
> Attachments: MAPREDUCE-5873.v1.patch, MAPREDUCE-5873.v2.patch,
> MAPREDUCE-5873.v3.patch, MAPREDUCE-5873.v4.patch, MAPREDUCE-5873.v5.patch,
> MAPREDUCE-5873.v6.patch
>
>
> Currently ShuffleScheduler in ReduceTask JVM status displays bandwidth. Its
> definition however is confusing because it captures the time where there is
> no copying because there is a pause between when new wave of map outputs is
> available.
> current bw is definded as (bytes copied so far) / (total time in the copy
> phase so far)
> It would be more useful
> 1) to measure bandwidth of a single copy call.
> 2) display aggregated bw as long as there is at least one fetcher is in the
> copy call.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)