Skip to content
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

feat: Add the PartitionCountWatchingPublisher #387

Merged
merged 3 commits into from
Dec 3, 2020

Conversation

palmere-google
Copy link
Contributor

This publisher watches the partition count and adds partitions when the topic's partition count increases.

@palmere-google palmere-google requested a review from a team as a code owner November 22, 2020 18:08
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 22, 2020
@product-auto-label product-auto-label bot added the api: pubsublite Issues related to the googleapis/java-pubsublite API. label Nov 22, 2020
publishers.values().forEach(ApiService::stopAsync);
publishers.values().forEach(ApiService::awaitTerminated);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this RoutingPublisher, almost exactly? Can't you just use RoutingPublisher for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I spent a while trying to do that. The awkward bit is that RoutingPublisher is a ProxyApiService which contains all of its partition level publishers.

This makes it challenging to install an new routing publisher when the number of partitions changes, since it's not currently possible to add started services to a ProxyApiService, and it's not possible to remove services either.

@codecov
Copy link

codecov bot commented Nov 24, 2020

Codecov Report

Merging #387 (ab797b3) into master (6e1f755) will increase coverage by 0.44%.
The diff coverage is 89.28%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #387      +/-   ##
============================================
+ Coverage     72.39%   72.83%   +0.44%     
- Complexity      783      801      +18     
============================================
  Files           148      150       +2     
  Lines          4191     4300     +109     
  Branches        204      215      +11     
============================================
+ Hits           3034     3132      +98     
- Misses         1042     1050       +8     
- Partials        115      118       +3     
Impacted Files Coverage Δ Complexity Δ
.../wire/PartitionCountWatchingPublisherSettings.java 33.33% <33.33%> (ø) 2.00 <2.00> (?)
...loud/pubsublite/internal/DefaultRoutingPolicy.java 52.94% <75.00%> (+2.94%) 2.00 <0.00> (ø)
...internal/wire/PartitionCountWatchingPublisher.java 98.92% <98.92%> (ø) 17.00 <17.00> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6e1f755...ab797b3. Read the comment docs.

@dpcollins-google dpcollins-google merged commit 74a8504 into master Dec 3, 2020
@dpcollins-google dpcollins-google deleted the increase_partitions2 branch December 3, 2020 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants