Skip to content

Conversation

@aniketalhat
Copy link

No description provided.

@aniketalhat aniketalhat changed the title [WIP] STORM-3082 Add support to handle absent topics STORM-3082 Add support to handle absent topics Jul 6, 2018
@srdo
Copy link
Contributor

srdo commented Jul 6, 2018

@aniketalhat I think you are targeting the wrong branch. You should target the branch you started working on (e.g. 1.x-branch).

We can review 1.x first, but we'll also need a PR against master at some point before we can merge this.

@srdo
Copy link
Contributor

srdo commented Jul 6, 2018

I guess this should target 1.0.x-branch, going by the listed commits.

@aniketalhat aniketalhat changed the base branch from master to 1.x-branch July 7, 2018 04:18
@aniketalhat
Copy link
Author

aniketalhat commented Jul 7, 2018

@srdo I updated the base as per your suggestions, thank you

@aniketalhat aniketalhat changed the base branch from 1.x-branch to 1.0.x-branch July 7, 2018 04:23

public SimpleConsumer register(Broker host, String topic, int partition) {
if (!_connections.containsKey(host)) {

Copy link
Author

@aniketalhat aniketalhat Jul 7, 2018

Choose a reason for hiding this comment

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

Not sure what happened here

Copy link
Contributor

Choose a reason for hiding this comment

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

Me neither. You can just revert the file and this change should go away.

Copy link
Contributor

@srdo srdo left a comment

Choose a reason for hiding this comment

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

Looks good, only have a few comments. Once the changes are done, please squash to one commit. At that point we can try cherry-picking these changes to master.

for (String topic : topics) {
for (PartitionInfo partitionInfo: consumer.partitionsFor(topic)) {
allPartitions.add(new TopicPartition(partitionInfo.topic(), partitionInfo.partition()));
if(consumer.partitionsFor(topic) != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be better to put the result of partitionsFor in a variable, rather than asking for it twice

Copy link
Author

Choose a reason for hiding this comment

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

@srdo I thought JIT will inline it but sure

Copy link
Contributor

Choose a reason for hiding this comment

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

Whether it inlines the method or not, the code is still executed twice. Besides, extracting to a variable means we don't have to worry about stuff like someone making a change to one call and not another, and it makes the code less noisy.


List<TopicPartition> presentPartitions = filter.getFilteredTopicPartitions(consumerMock);
assertThat("Expected filter to pass only topics which are present", presentPartitions,
containsInAnyOrder(new TopicPartition(presentTopic, 2)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: When there is only one entry, you don't have to specify "in any order" :)


public SimpleConsumer register(Broker host, String topic, int partition) {
if (!_connections.containsKey(host)) {

Copy link
Contributor

Choose a reason for hiding this comment

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

Me neither. You can just revert the file and this change should go away.

@aniketalhat aniketalhat force-pushed the feature/STORM-3082-Add-support-to-handle-absent-topics branch from c699a3c to 0cacb10 Compare July 9, 2018 03:11
@HeartSaVioR
Copy link
Contributor

HeartSaVioR commented Jul 9, 2018

While this PR is based on 1.0.x-branch since the branch is based on that branch, I guess we wouldn't want to maintain 1.0.x-branch any more. We would be better to cherry pick squashed commit into active version lines other than merging this PR itself.

@srdo
Copy link
Contributor

srdo commented Jul 9, 2018

Oops, yes. Jungtaek is right, I don't think we're working on 1.0.x anymore. The changes look good to me. +1. I'll try cherry-picking these changes to master, 1.x and 1.1.x in a bit.

@srdo
Copy link
Contributor

srdo commented Jul 9, 2018

@aniketalhat Thanks for the fix. I cherry picked the changes to master, 1.x and 1.1.x. Could you please close this PR, as the changes have been merged?

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.

4 participants