-
Notifications
You must be signed in to change notification settings - Fork 453
[CELEBORN-2376] Filter empty ResourceConsumption entries in WorkerInfo toString output #3754
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,6 +76,11 @@ case class ResourceConsumption( | |
| (add(other._1), addSubResourceConsumptions(other._2)) | ||
| } | ||
|
|
||
| def isEmpty: Boolean = { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistency / reuse: there's already an equivalent "filter out empty user resource consumption" predicate that feeds This new Consider unifying: either have |
||
| diskBytesWritten == 0 && diskFileCount == 0 && hdfsBytesWritten == 0 && hdfsFileCount == 0 && | ||
| CollectionUtils.isEmpty(subResourceConsumptions) | ||
| } | ||
|
|
||
| override def toString: String = { | ||
| val subResourceConsumptionString = | ||
| if (CollectionUtils.isEmpty(subResourceConsumptions)) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage: the PR says "Covered by existing unit tests", but the existing
WorkerInfoSuite"toString output" case doesn't actually exercise this new branch.worker4renders a single non-zero entry, andworker1-worker3have empty maps that hit the outeruserResourceConsumption.isEmptybranch. Nothing covers:ResourceConsumption(0, 0, 0, 0)) being filtered out,if (rendered.isEmpty) "empty"fallback when every entry is filtered.Worth adding a small case so a future regression that re-renders zero entries is caught.