Repository navigation
[PIP-51] Introduce sticky consumer - #5388
Conversation
|
run java8 tests |
1 similar comment
|
run java8 tests |
|
run java8 tests |
|
retest this please |
2 similar comments
|
retest this please |
|
retest this please |
|
rerun cpp tests |
1 similar comment
|
rerun cpp tests |
|
run java8 tests |
1 similar comment
|
run java8 tests |
|
run java8 tests |
|
run integration tests |
2 similar comments
|
run integration tests |
|
run integration tests |
|
@codelipenghui this needs to be PIP-47? |
|
@sijie Yes, it should be PIP-47 |
4c3e590 to
bb18d12
Compare
|
run java8 tests |
|
run java8 tests |
|
run cpp tests |
sijie
left a comment
There was a problem hiding this comment.
@codelipenghui implementation looks good to me in general. however I don't think we should let user specify the total hash range. we should pick a fixed hash range (e.g. 0~66536), and provide util functions for consumers to split the hash range based on their requirements. please take a look at my detailed comment below.
There was a problem hiding this comment.
Yes, STICKY is more simpler
There was a problem hiding this comment.
I don't think we should allow users to configure thee totalHashRange. The hash range should be fixed (e.g. 0.0 ~ 1.0, Long.MIN_VALUE ~ Long.MAX_VALUE, or Integer.MIN_VALUE to Integer.MAX_VALUE, or 0 ~ 66536). Just pick up a range, and let consumer specify the hash range.
Allowing user configuring the totalHashRange introduces inconsistent across consumers of a subscription. people can make mistakes.
There was a problem hiding this comment.
Ok, i will fix by using a fixed range(0-65536), current total range for key shared subscription is also (0-65536)
There was a problem hiding this comment.
Guava has a Range class. You might consider reusing its class.
There was a problem hiding this comment.
The pulsar client api module do not add guava dependency, shall we add the guava dependency?
d750988 to
a39e2e5
Compare
|
@sijie I have addressed you comments except the new Range class in pulsar client api module, because currently the pulsar client api module do not add guava dependency, considering to keep api module thin, so i add the new Range class. |
sijie
left a comment
There was a problem hiding this comment.
@codelipenghui lgtm. this is a great addon to key_shared subscription.
I left one minor comment.
| } | ||
|
|
||
| enum KeySharedMode { | ||
| autoSplit = 0; |
There was a problem hiding this comment.
can you use upper case for enums?
AUTO_SPLIT = 0;
STICKY = 1;
|
@codelipenghui can you update the enum? |
|
@sijie I can update it tomorrow, my mac book has some problems with docker environment, can not build the proto. need to build them on another machine 😊 |
|
run java8 tests |
|
@sijie I have updated the enum in PulsarApi.proto |
Motivation
Introduce sticky consumer, users can enable it by
Modifications
Add a new consumer selector named HashRangeExclusiveStickyKeyConsumerSelector to support sticky consumer.
This change added tests and can be verified as follows:
Add new unit tests.
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation