-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Generalize repo analysis #93899
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
Generalize repo analysis #93899
Conversation
In elastic#93825 we introduced a CAS operation on snapshot repositories. In due course we'll want to verify that this operation works as expected using the repository analysis API. This commit reworks the implementation slightly so as to simplify the change which will add this functionality.
Pinging @elastic/es-distributed (Team:Distributed) |
import java.util.concurrent.Semaphore; | ||
import java.util.function.BiConsumer; | ||
|
||
public class ThrottledIterator<T> implements Releasable { |
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.
This class (and its test suite) extracted from #93735.
} | ||
} | ||
|
||
private final RefCounted throttleRefs; |
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.
nit: I find throttleRefs
a bit confusing in this context, for what I understand this reference count does not control the throttling, it's used to notify the listener once all the tasks have finished, maybe we can find a clearer name?
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.
Sure, on reflection refs
seems better to me.
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.
LGTM, I left a minor comment about a field name. 👍
In elastic#93825 we introduced a CAS operation on snapshot repositories. In due course we'll want to verify that this operation works as expected using the repository analysis API. This commit reworks the implementation slightly so as to simplify the change which will add this functionality.
In #93825 we introduced a CAS operation on snapshot repositories. In due course we'll want to verify that this operation works as expected using the repository analysis API. This commit reworks the implementation slightly so as to simplify the change which will add this functionality.