[BEAM-2724] Preparing support for Structured Names in Dataflow counters#3684
Closed
pabloem wants to merge 1 commit intoapache:masterfrom
Closed
[BEAM-2724] Preparing support for Structured Names in Dataflow counters#3684pabloem wants to merge 1 commit intoapache:masterfrom
pabloem wants to merge 1 commit intoapache:masterfrom
Conversation
|
Changes Unknown when pulling b1e15ab on pabloem:add-countername into ** on apache:master**. |
b1e15ab to
a4176f8
Compare
Member
Author
|
r: @aaltay |
aaltay
reviewed
Aug 9, 2017
| self.system_name = system_name | ||
| self.output_index = output_index | ||
|
|
||
| def __hash__(self): |
Member
There was a problem hiding this comment.
Do you need the hash function? What is the default one?
Member
Author
There was a problem hiding this comment.
The default hash function is related to the id() of the object. This means that without overriding it, this would be True:
hash(CounterName('arg1', 'arg2', 'arg3', 'arg4')) != hash(CounterName('arg1', 'arg2', 'arg3', 'arg4'))
I need counters to be indexable by their name. e.g.
my_d = {CounterName('arg1', 'arg2', 'arg3', 'arg4'): my_counter}
assert my_d[CounterName('arg1', 'arg2', 'arg3', 'arg4')] == my_counter
That's why I need to override the hash function. In fact, I'll add unit tests for this.
Member
Author
There was a problem hiding this comment.
Member
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow this checklist to help us incorporate your contribution quickly and easily:
[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue.mvn clean verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.apiclient.pyfile that are no longer used.