afterincomparableyum commented on code in PR #3611:
URL: https://github.com/apache/celeborn/pull/3611#discussion_r3007746570
##########
cpp/celeborn/client/writer/PushState.cpp:
##########
@@ -235,6 +237,32 @@ void PushState::cleanup() {
}
}
+bool PushState::addBatchData(
+ const std::string& addressPairKey,
+ std::shared_ptr<const protocol::PartitionLocation> loc,
+ int batchId,
+ std::unique_ptr<memory::ReadOnlyByteBuffer> body) {
+ auto batches = batchesMap_.computeIfAbsent(
+ addressPairKey, [&]() { return std::make_shared<DataBatches>(); });
+ batches->addDataBatch(std::move(loc), batchId, std::move(body));
+ return batches->getTotalSize() > pushBufferMaxSize_;
+}
+
+std::shared_ptr<DataBatches> PushState::takeDataBatches(
+ const std::string& addressPairKey) {
+ auto result = batchesMap_.get(addressPairKey);
+ if (result.has_value()) {
+ batchesMap_.erase(addressPairKey);
+ return result.value();
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]