Skip to content
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

[CELEBORN-1914] incWriteTime when ShuffleWriter invoke pushGiantRecord #3155

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ private byte[] getOrCreateBuffer(int partitionId) {

protected void pushGiantRecord(int partitionId, byte[] buffer, int numBytes) throws IOException {
logger.debug("Push giant record, size {}.", numBytes);
long start = System.nanoTime();
int bytesWritten =
shuffleClient.pushData(
shuffleId,
Expand All @@ -288,8 +289,10 @@ protected void pushGiantRecord(int partitionId, byte[] buffer, int numBytes) thr
numBytes,
numMappers,
numPartitions);
long delta = System.nanoTime() - start;
mapStatusLengths[partitionId].add(bytesWritten);
writeMetrics.incBytesWritten(bytesWritten);
writeMetrics.incWriteTime(delta);
}

private int getOrUpdateOffset(int partitionId, int serializedRecordSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ private void write0(scala.collection.Iterator iterator) throws IOException {

private void pushGiantRecord(int partitionId, byte[] buffer, int numBytes) throws IOException {
logger.debug("Push giant record, size {}.", Utils.bytesToString(numBytes));
long start = System.nanoTime();
int bytesWritten =
shuffleClient.pushData(
shuffleId,
Expand All @@ -357,8 +358,10 @@ private void pushGiantRecord(int partitionId, byte[] buffer, int numBytes) throw
numBytes,
numMappers,
numPartitions);
long delta = System.nanoTime() - start;
mapStatusLengths[partitionId].add(bytesWritten);
writeMetrics.incBytesWritten(bytesWritten);
writeMetrics.incWriteTime(delta);
}

private void cleanupPusher() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ private void check(
ShuffleWriteMetrics metrics = taskContext.taskMetrics().shuffleWriteMetrics();
assertEquals(metrics.recordsWritten(), total.intValue());
assertEquals(metrics.bytesWritten(), tempFile.length());
assertTrue(metrics.writeTime() > 0);

try (FileInputStream fis = new FileInputStream(tempFile)) {
Iterator it = newSerializerInstance(serializer).deserializeStream(fis).asKeyValueIterator();
Expand Down
Loading