Skip to content

SAMZA-2302: Add equals, hashcode and toString to KV - #1138

Merged
xinyuiscool merged 2 commits into
apache:masterfrom
xinyuiscool:SAMZA-2302
Aug 15, 2019
Merged

xinyuiscool merged 2 commits into
apache:masterfrom
xinyuiscool:SAMZA-2302

Conversation

@xinyuiscool

Copy link
Copy Markdown
Contributor

The current KV class misses these primitive methods so that it can be used correctly in comparison, map or hash. Adding these methods to fix it.

@xinyuiscool

Copy link
Copy Markdown
Contributor Author

@cameronlee314 : please take a look. Thx!

Comment thread samza-api/src/main/java/org/apache/samza/operators/KV.java

@mynameborat mynameborat left a comment

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.

Sync'd up offline.

return false;
}
KV<?, ?> otherKv = (KV<?, ?>) other;
return Objects.deepEquals(this.key, otherKv.key)

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.

Please add a comment about why we need deepEquals and that this implementation comes from Beam.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added.

@xinyuiscool
xinyuiscool merged commit dcdf229 into apache:master Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants