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
KAFKA-10316: Consider renaming getter method for Interactive Queries #9120
KAFKA-10316: Consider renaming getter method for Interactive Queries #9120
Conversation
* Deprecated the existing getters and added new getters `activeHost()`, `standbyHosts()`, and `partition()` to KeyQueryMetadata.java. * Update the existing Tests to use the new getters of KeyQueryMetadata.java . Below are the Test classes that were updated with new getters. OptimizedKTableIntegrationTest.java QueryableStateIntegrationTest.java StoreQueryIntegrationTest.java StreamsMetadataStateTest.java
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.
Thanks for the PR @johnthotekat!
Just some JavaDocs nits. I understand it's c&p but it seem the original JavaDocs are not "ideal" and we should just improve it -- if you want, you could also update the JavaDocs of the deprecated methods accordingly (I leave it up to you if you want to do this or not -- I am fine either way).
public int getPartition() { | ||
return partition; | ||
} | ||
|
||
/** | ||
* Get the Active streams instance for given key |
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.
Nit: [a]ctive
(i understand that it's just c&p but it seem wrong in the original JavaDoc, too.
streams
-> Kafka Streams
Also, missing .
at the end of the sentence.
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.
I'm with you, we should fix it, for the deprecated ones too.
Fixed.
} | ||
|
||
/** | ||
* Get the Streams instances that host the key as standbys |
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.
nit: Streams
-> Kafka Streams
Also, missing .
at the end of the sentence.
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.
Fixed.
} | ||
|
||
/** | ||
* Get the Store partition corresponding to the key. |
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.
[s]tore
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.
Fixed.
Retest this please. |
* Deprecated the existing getters and added new getters `activeHost()`, `standbyHosts()`, and `partition()` to KeyQueryMetadata.java. * Update the existing Tests to use the new getters of KeyQueryMetadata.java . Below are the Test classes that were updated with new getters. OptimizedKTableIntegrationTest.java QueryableStateIntegrationTest.java StoreQueryIntegrationTest.java StreamsMetadataStateTest.java * Correcting some JavaDoc nits.
/** | ||
* Get the store partition corresponding to the key. | ||
* | ||
* @return store partition number |
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.
I feel it should be "key partition number" instead of store.
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.
We are fetching the state store partition number corresponding to the key with this getter and hence that description I believe.
More over, this is a copy paste work, we copied existing getter's with a new name and deprecated the old getter's.
Any specific reason why you feel that the description should be "key partition number" ?
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.
@mjsax Please correct me if I'm wrong.
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.
I wrote the old getters & javadocs but now I feel that key partition number better conveys the meaning than store partition number.
The class KeyQueryMetadata contains the information for a key being requested via query. So, the partition number we are returning here is the partition to which the key belongs, it has no relation to any store yet. You will of course use this partition information to fetch the data corresponding to the key from any store but still that doesn't change the fact that this partition number is related to the key rather than the store.
I am fine either way though.
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.
IMHO, "key partition number" sound like as if the key would be partitioned, and we get the partition number for the "key partition". But in fact, the store is partitioned and thus I think the current "store partition number" is ok as-is.
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.
Sure, that's fine.
} | ||
|
||
/** | ||
* Get the store partition corresponding to the key. |
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.
Get the partition number corresponding to the key.
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.
Relatable to the comments from line 106 right ?
Retest this please. |
1 similar comment
Retest this please. |
Thanks @johnthotekat for the PR. LGTM! |
Merge apache/kafka to johnthotekat/kafka
…tps://github.com/johnthotekat/kafka into KAFKA-10316-renaming-getter-method
@mjsax One of the test failed for me in local, This one - KafkaAdminClientTest#testMetadataRetries. I guess its the same issue we are addressing with https://issues.apache.org/jira/browse/KAFKA-10311 ? There is also an open PR under this.
|
@johnthotekat Some testa are know to be flaky and we try to work on them to avoid those build issues. It's constant effort to keep the build stable. Will trigger a new Jenkins run and can merge after it passed. I also saw that you merge changes from |
Retest this please. |
2 similar comments
Retest this please. |
Retest this please. |
Ok to test. |
I'll try again later... Jenkins seems to be on holidays... |
Retest this please. |
I did a pull to my branch just to make sure that my branch has all the recent changes (reason behind is the flaky test and I saw the PR for that flaky fix) and that's how that merge from And I really thought you put in the comments "Retest this please". :) |
Thanks for the KIP and PR @johnthotekat. Merged to |
One more thing: could you do a second PR to update the docs accordingly? We should list the KIP at lest in |
Updated Streams documentation with the new method details in KeyQueryMetadata. apache#9120
*Deprecated the existing getters and added new getters
activeHost()
,standbyHosts()
, andpartition()
in KeyQueryMetadata.java.*Updated the existing Tests to use the new getters of KeyQueryMetadata.java . Below are the Test classes that were updated with new getters.
*Corrected JavaDoc nits in the deprecated methods.
@mjsax @abbccdda @vvcephei @brary Since you've voted on the KIP, please feel free to review.
Committer Checklist (excluded from commit message)