Skip to content

Commit 92643f2

Browse files
committed
Fix merge with outer
1 parent 46150bc commit 92643f2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/resourcehints/ResourceHint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public abstract class ResourceHint {
2828
* environment. Override this method for a custom reconciliation logic. If is_inverse is true the
2929
* merge result will be flipped.
3030
*/
31-
public ResourceHint mergeWithOuter(ResourceHint outer, boolean is_inverse) {
31+
public ResourceHint mergeWithOuter(ResourceHint outer, boolean is_sum) {
3232
// Defaults to the inner value as it is the most specific one.
33-
return is_inverse ? outer : this;
33+
return this;
3434
}
3535

3636
/** Defines how to represent the as bytestring. */

sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/resourcehints/ResourceHints.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ public static long parse(String s) {
181181
}
182182

183183
@Override
184-
public ResourceHint mergeWithOuter(ResourceHint outer, boolean is_inverse) {
185-
return is_inverse
186-
? new BytesHint(Math.min(value, ((BytesHint) outer).value))
184+
public ResourceHint mergeWithOuter(ResourceHint outer, boolean is_sum) {
185+
return is_sum
186+
? new BytesHint(value + ((BytesHint) outer).value)
187187
: new BytesHint(Math.max(value, ((BytesHint) outer).value));
188188
}
189189

0 commit comments

Comments
 (0)