@@ -218,6 +218,16 @@ inline std::string createShuffleFileName(
218218}
219219} // namespace
220220
221+ std::string LocalShuffleWriteInfo::serialize () const {
222+ json obj;
223+ obj[" rootPath" ] = rootPath;
224+ obj[" queryId" ] = queryId;
225+ obj[" shuffleId" ] = shuffleId;
226+ obj[" numPartitions" ] = numPartitions;
227+ obj[" sortedShuffle" ] = sortedShuffle;
228+ return obj.dump ();
229+ }
230+
221231LocalShuffleWriteInfo LocalShuffleWriteInfo::deserialize (
222232 const std::string& info) {
223233 const auto jsonReadInfo = json::parse (info);
@@ -230,6 +240,15 @@ LocalShuffleWriteInfo LocalShuffleWriteInfo::deserialize(
230240 return shuffleInfo;
231241}
232242
243+ std::string LocalShuffleReadInfo::serialize () const {
244+ json obj;
245+ obj[" rootPath" ] = rootPath;
246+ obj[" queryId" ] = queryId;
247+ obj[" partitionIds" ] = partitionIds;
248+ obj[" sortedShuffle" ] = sortedShuffle;
249+ return obj.dump ();
250+ }
251+
233252LocalShuffleReadInfo LocalShuffleReadInfo::deserialize (
234253 const std::string& info) {
235254 const auto jsonReadInfo = json::parse (info);
@@ -357,6 +376,8 @@ void LocalShuffleWriter::collect(
357376 sortedShuffle_ || key.empty (),
358377 " key '{}' must be empty for non-sorted shuffle" ,
359378 key);
379+ velox::common::testutil::TestValue::adjust (
380+ " facebook::presto::operators::LocalShuffleWriter::collect" , this );
360381
361382 const auto rowSize = this ->rowSize (key.size (), data.size ());
362383 auto & buffer = inProgressPartitions_[partition];
@@ -521,6 +542,8 @@ LocalShuffleReader::next(uint64_t maxBytes) {
521542 VELOX_CHECK (
522543 initialized_,
523544 " LocalShuffleReader::initialize() must be called before next()" );
545+ velox::common::testutil::TestValue::adjust (
546+ " facebook::presto::operators::LocalShuffleReader::next" , this );
524547
525548 return folly::makeSemiFuture (
526549 sortedShuffle_ ? nextSorted (maxBytes) : nextUnsorted (maxBytes));
@@ -597,13 +620,4 @@ std::shared_ptr<ShuffleWriter> LocalPersistentShuffleFactory::createWriter(
597620 writeInfo.sortedShuffle ,
598621 pool);
599622}
600-
601- // Testing function to expose extractRowMetadata for tests.
602- // This will be removed after reader changes.
603- std::vector<RowMetadata> testingExtractRowMetadata (
604- const char * buffer,
605- size_t bufferSize,
606- bool sortedShuffle) {
607- return extractRowMetadata (buffer, bufferSize, sortedShuffle);
608- }
609623} // namespace facebook::presto::operators
0 commit comments