Skip to content

Commit 1623acc

Browse files
shangm2NikhilCollooru
authored andcommitted
Convert DataSize for cpp worker
1 parent d930d69 commit 1623acc

File tree

4 files changed

+220
-235
lines changed

4 files changed

+220
-235
lines changed

presto-native-execution/presto_cpp/main/PrestoTask.cpp

+12-27
Original file line numberDiff line numberDiff line change
@@ -361,25 +361,21 @@ void updatePipelineStats(
361361
prestoOp.inputPositions = veloxOp.inputPositions;
362362
prestoOp.sumSquaredInputPositions =
363363
((double)veloxOp.inputPositions) * veloxOp.inputPositions;
364-
prestoOp.inputDataSize =
365-
protocol::DataSize(veloxOp.inputBytes, protocol::DataUnit::BYTE);
364+
prestoOp.inputDataSizeInBytes = veloxOp.inputBytes;
366365
prestoOp.rawInputPositions = veloxOp.rawInputPositions;
367-
prestoOp.rawInputDataSize =
368-
protocol::DataSize(veloxOp.rawInputBytes, protocol::DataUnit::BYTE);
366+
prestoOp.rawInputDataSizeInBytes = veloxOp.rawInputBytes;
369367

370368
// Report raw input statistics on the Project node following TableScan, if
371369
// exists.
372370
if (j == 1 && veloxOp.operatorType == "FilterProject" &&
373371
veloxPipelineStats.operatorStats[0].operatorType == "TableScan") {
374372
const auto& scanOp = veloxPipelineStats.operatorStats[0];
375373
prestoOp.rawInputPositions = scanOp.rawInputPositions;
376-
prestoOp.rawInputDataSize =
377-
protocol::DataSize(scanOp.rawInputBytes, protocol::DataUnit::BYTE);
374+
prestoOp.rawInputDataSizeInBytes = scanOp.rawInputBytes;
378375
}
379376

380377
prestoOp.outputPositions = veloxOp.outputPositions;
381-
prestoOp.outputDataSize =
382-
protocol::DataSize(veloxOp.outputBytes, protocol::DataUnit::BYTE);
378+
prestoOp.outputDataSizeInBytes = veloxOp.outputBytes;
383379

384380
setTiming(
385381
veloxOp.isBlockedTiming,
@@ -408,25 +404,14 @@ void updatePipelineStats(
408404
prestoOp.blockedWall = protocol::Duration(
409405
veloxOp.blockedWallNanos, protocol::TimeUnit::NANOSECONDS);
410406

411-
prestoOp.userMemoryReservation = protocol::DataSize(
412-
veloxOp.memoryStats.userMemoryReservation, protocol::DataUnit::BYTE);
413-
prestoOp.revocableMemoryReservation = protocol::DataSize(
414-
veloxOp.memoryStats.revocableMemoryReservation,
415-
protocol::DataUnit::BYTE);
416-
prestoOp.systemMemoryReservation = protocol::DataSize(
417-
veloxOp.memoryStats.systemMemoryReservation, protocol::DataUnit::BYTE);
418-
prestoOp.peakUserMemoryReservation = protocol::DataSize(
419-
veloxOp.memoryStats.peakUserMemoryReservation,
420-
protocol::DataUnit::BYTE);
421-
prestoOp.peakSystemMemoryReservation = protocol::DataSize(
422-
veloxOp.memoryStats.peakSystemMemoryReservation,
423-
protocol::DataUnit::BYTE);
424-
prestoOp.peakTotalMemoryReservation = protocol::DataSize(
425-
veloxOp.memoryStats.peakTotalMemoryReservation,
426-
protocol::DataUnit::BYTE);
427-
428-
prestoOp.spilledDataSize =
429-
protocol::DataSize(veloxOp.spilledBytes, protocol::DataUnit::BYTE);
407+
prestoOp.userMemoryReservationInBytes = veloxOp.memoryStats.userMemoryReservation;
408+
prestoOp.revocableMemoryReservationInBytes = veloxOp.memoryStats.revocableMemoryReservation;
409+
prestoOp.systemMemoryReservationInBytes = veloxOp.memoryStats.systemMemoryReservation;
410+
prestoOp.peakUserMemoryReservationInBytes = veloxOp.memoryStats.peakUserMemoryReservation;
411+
prestoOp.peakSystemMemoryReservationInBytes = veloxOp.memoryStats.peakSystemMemoryReservation;
412+
prestoOp.peakTotalMemoryReservationInBytes = veloxOp.memoryStats.peakTotalMemoryReservation;
413+
414+
prestoOp.spilledDataSizeInBytes = veloxOp.spilledBytes;
430415

431416
if (veloxOp.operatorType == "HashBuild") {
432417
prestoOp.joinBuildKeyCount = veloxOp.inputPositions;

presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int64_t sumOpSpillBytes(
101101
if (opStats.operatorType != opType) {
102102
continue;
103103
}
104-
sum += opStats.spilledDataSize.getValue(protocol::DataUnit::BYTE);
104+
sum += opStats.spilledDataSizeInBytes;
105105
}
106106
}
107107
return sum;

0 commit comments

Comments
 (0)