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

IGNITE-15568 Striped Disruptor doesn't work with JRaft event handlers… #3772

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vldpyatkov
Copy link
Contributor

.setProducerType(ProducerType.MULTI)
.setWaitStrategy(useYieldStrategy ? new YieldingWaitStrategy() : new BlockingWaitStrategy())
.build();
.setRingBufferSize(bufferSize)
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting seems incorrect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I applied fromat that we use for all cod in our project, except the ignite-raft.
So you think this is because our format never applied to the code before, but it is right.

@@ -121,7 +124,7 @@ public StripedDisruptor(
* @param eventFactory Event factory for the Striped disruptor.
* @param stripes Amount of stripes.
* @param supportsBatches If {@code false}, this stripe will always pass {@code true} into
* {@link EventHandler#onEvent(Object, long, boolean)}. Otherwise, the data will be provided with batches.
* {@link EventHandler#onEvent(Object, long, boolean)}. Otherwise, the data will be provided with batches.
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting seems incorrect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The same as above. I have checked the formatting again.

@@ -289,10 +301,14 @@ private class StripeEntryHandler implements EventHandler<T> {
*/
StripeEntryHandler(int stripeId) {
this.stripeId = stripeId;

eventCache = supportsBatches ? null : new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have different implementations of EventHandler for manual and build-in batching ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't have a different implementation.
The flag is used in the only scenario where the log storage is shared. For the shared log storage, we can handle the last messages (for the current batch) at the storage level. Althougр, this message might be intended for another handler in the same stripe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants