Skip to content

Conversation

@hellostreaming
Copy link
Contributor

@hellostreaming hellostreaming commented Mar 10, 2018

Motivation

Currently we have both TopicsConsumerImpl and PartitionedConsumerImpl. The behaviour and code of them are similar: contains a list of ConsumerImpl and make them work together. This PR tries to delete PartitionedConsumerImpl and use TopicsConsumerImpl instead.

Modifications

Delete PartitionedConsumerImpl, use TopicsConsumerImpl instead.
Fix errors in TopicsConsumerImpl.

Result

No api changes.

@hellostreaming hellostreaming changed the title elete partitionedConsumer, use topicsConsumer instead Delete PartitionedConsumerImpl, use TopicsConsumerImpl instead Mar 10, 2018
@hellostreaming
Copy link
Contributor Author

@merlimat @sijie Would you please help review this. Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

any reason that topic is removed before closing the actual consumers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, Thanks, will move it into line 746, when all consumers closed.

@hellostreaming
Copy link
Contributor Author

rebased master, checked no leaking change in PartitionedConsumerImpl

@hellostreaming
Copy link
Contributor Author

retest this please

1 similar comment
@hellostreaming
Copy link
Contributor Author

retest this please

@hellostreaming
Copy link
Contributor Author

@merlimat Would you please help review this?

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

I don't see the PartitionedConsumerImpl class being removed in this PR. Is that intentional?

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 we could also rename TopicsConsumerImpl into MultiTopicsConsumerImpl, because TopicsConsumerImpl doesn't immediately convey that it's working on a collection of topics.

Copy link
Contributor

Choose a reason for hiding this comment

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

How does TopicsConsumerImpl discover the partitions it has to use?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, this is similar to what we did in partitioned consumer, mainly by getPartitionedTopicMetadata.
In TopicsConsumerImpl we call subscribeAsync(topic) for the topic in conf, and this will call getPartitionedTopicMetadata again.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, though since we already know the number of partitions, we already know the list of partition names. Couldn't we just build the list and pass it on to the MultiTopicsConsumerImpl?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will do the change to avoid the dup calling of get metadata.

@hellostreaming
Copy link
Contributor Author

@merlimat, thanks for the review. PartitionedConsumerImpl should be remove, but was wrongly get back when do last rebase, now removed it.

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

Change looks good. I just have one comment on the initialization path.

@merlimat merlimat added the type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use label Apr 2, 2018
@merlimat merlimat added this to the 2.0.0-incubating milestone Apr 2, 2018
@hellostreaming hellostreaming force-pushed the issue_1236 branch 3 times, most recently from 920a966 to ff2b969 Compare April 3, 2018 06:51
@hellostreaming
Copy link
Contributor Author

hellostreaming commented Apr 3, 2018

seems CI build error could fix with #1489, may need retry after it merged

@hellostreaming
Copy link
Contributor Author

retest this please

@merlimat
Copy link
Contributor

merlimat commented Apr 3, 2018

@zhaijack please merge this branch with master to get the compilation fixed

@hellostreaming
Copy link
Contributor Author

Seems there was no conflict, lt should be well.

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

👍

@merlimat merlimat merged commit 1dd9c43 into apache:master Apr 4, 2018
RobertIndie pushed a commit that referenced this pull request Aug 31, 2022
…sConsumerImpl instead (#16969)

### Motivation

The code of the C++ client is still relatively old, after #1365, the java client used `MultiTopicConsumerImpl` instead of `PartitionedConsumerImpl`. 

### Modifications
- Delete PartitionedConsumerImpl, use MultiTopicsConsumerImpl instead.
- For MultiTopicConsumerImpl, support seek message and topic partition listener feature.
BewareMyPower pushed a commit that referenced this pull request Sep 13, 2022
…sConsumerImpl instead (#16969)

### Motivation

The code of the C++ client is still relatively old, after #1365, the java client used `MultiTopicConsumerImpl` instead of `PartitionedConsumerImpl`.

### Modifications
- Delete PartitionedConsumerImpl, use MultiTopicsConsumerImpl instead.
- For MultiTopicConsumerImpl, support seek message and topic partition listener feature.

(cherry picked from commit 3a3ae23)
BewareMyPower pushed a commit that referenced this pull request Sep 13, 2022
…sConsumerImpl instead (#16969)

### Motivation

The code of the C++ client is still relatively old, after #1365, the java client used `MultiTopicConsumerImpl` instead of `PartitionedConsumerImpl`.

### Modifications
- Delete PartitionedConsumerImpl, use MultiTopicsConsumerImpl instead.
- For MultiTopicConsumerImpl, support seek message and topic partition listener feature.

(cherry picked from commit 3a3ae23)
BewareMyPower pushed a commit that referenced this pull request Sep 13, 2022
…sConsumerImpl instead (#16969)

### Motivation

The code of the C++ client is still relatively old, after #1365, the java client used `MultiTopicConsumerImpl` instead of `PartitionedConsumerImpl`.

### Modifications
- Delete PartitionedConsumerImpl, use MultiTopicsConsumerImpl instead.
- For MultiTopicConsumerImpl, support seek message and topic partition listener feature.

(cherry picked from commit 3a3ae23)
BewareMyPower pushed a commit that referenced this pull request Sep 13, 2022
…sConsumerImpl instead (#16969)

### Motivation

The code of the C++ client is still relatively old, after #1365, the java client used `MultiTopicConsumerImpl` instead of `PartitionedConsumerImpl`.

### Modifications
- Delete PartitionedConsumerImpl, use MultiTopicsConsumerImpl instead.
- For MultiTopicConsumerImpl, support seek message and topic partition listener feature.

(cherry picked from commit 3a3ae23)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Sep 16, 2022
…sConsumerImpl instead (apache#16969)

### Motivation

The code of the C++ client is still relatively old, after apache#1365, the java client used `MultiTopicConsumerImpl` instead of `PartitionedConsumerImpl`.

### Modifications
- Delete PartitionedConsumerImpl, use MultiTopicsConsumerImpl instead.
- For MultiTopicConsumerImpl, support seek message and topic partition listener feature.

(cherry picked from commit 3a3ae23)
(cherry picked from commit 23da64b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants