Skip to content
Merged
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 @@ -82,6 +82,15 @@ ShuffleExchangeSource::requestDataSizes(std::chrono::microseconds /*maxWait*/) {
return folly::makeSemiFuture(Response{0, atEnd_, std::move(remainingBytes)});
}

bool ShuffleExchangeSource::supportsMetrics() const {
return shuffleReader_->supportsMetrics();
}

folly::F14FastMap<std::string, velox::RuntimeMetric>
ShuffleExchangeSource::metrics() const {
return shuffleReader_->metrics();
}

folly::F14FastMap<std::string, int64_t> ShuffleExchangeSource::stats() const {
return shuffleReader_->stats();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class ShuffleExchangeSource : public velox::exec::ExchangeSource {

folly::F14FastMap<std::string, int64_t> stats() const override;

bool supportsMetrics() const override;

folly::F14FastMap<std::string, velox::RuntimeMetric> metrics() const override;

/// url needs to follow below format:
/// batch://<taskid>?shuffleInfo=<serialized-shuffle-info>
static std::shared_ptr<velox::exec::ExchangeSource> createExchangeSource(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ class ShuffleReader {

/// Runtime statistics.
virtual folly::F14FastMap<std::string, int64_t> stats() const = 0;

/// Returns true if the shuffle reader supports Velox runtime metrics.
virtual bool supportsMetrics() const {
return false;
}

/// Returns statistics in the form of Velox runtime metrics.
virtual folly::F14FastMap<std::string, velox::RuntimeMetric> metrics() const {
VELOX_NYI();
Comment on lines +67 to +68
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Using VELOX_NYI() for metrics() may cause runtime errors if called unexpectedly.

Document that metrics() will throw if not overridden, or consider returning an empty map by default to prevent unexpected runtime errors.

}
};

class ShuffleInterfaceFactory {
Expand Down
Loading