-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Dataflow Streaming] Use concurrent queue for commit queue #33690
base: master
Are you sure you want to change the base?
Conversation
@@ -23,7 +23,6 @@ | |||
import java.util.Map; | |||
import org.apache.beam.sdk.expansion.ExternalTransformRegistrar; | |||
import org.apache.beam.sdk.io.aws2.common.ClientConfiguration; | |||
import org.apache.beam.sdk.io.aws2.kinesis.KinesisIO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
separate change?
Instant deadline = Instant.now().plus(timeout); | ||
int spin = 0; | ||
while (true) { | ||
if (++spin > 1000) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how much cpu does this burn if the queue is empty?
we could also look into other specialized queues like:
https://github.com/JCTools/JCTools/blob/master/jctools-core/src/main/java/org/jctools/queues/MpscBlockingConsumerArrayQueue.java
(random googling, would need some validation).
import org.checkerframework.checker.nullness.qual.Nullable; | ||
|
||
/** Queue bounded by a {@link WeightedSemaphore}. */ | ||
public final class WeightedBoundedQueue<V> { | ||
public final class WeightedBoundedQueue<V extends @NonNull Object> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to make this less generally named or at least comment on spinning so we know that before it gets used somewhere else.
No description provided.