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

Factor out StorageChecker #11

Closed
tombentley opened this issue Aug 17, 2021 · 0 comments
Closed

Factor out StorageChecker #11

tombentley opened this issue Aug 17, 2021 · 0 comments
Assignees

Comments

@tombentley
Copy link
Member

StaticQuotaCallback.StorageChecker is currently an inner class. It shares a bunch of state with StaticQuotaCallback via volatile fields.

  • This makes is hard to test.
  • Each of those fields will require a volatile read from main memory.

It would be better for StorageChecker to be a top level class.

Perhaps we could use some record class for its config, using an AtomicReference to share that config with the StaticQuotaCallback.

Or perhaps we just use an AtomicReference for the storageChecker itself, and on reconfiguration stop the existing thread and instantiate a new one.

@alesj alesj self-assigned this Aug 18, 2021
SamBarker pushed a commit to SamBarker/kafka-quotas-plugin that referenced this issue Sep 5, 2022
* Fix strimzi#11: Factor out StorageChecker

The intent of this refactoring is merely to decouple StorageChecker from StaticQuotaCallback, to facilitate better unit-cases

Signed-off-by: kwall <kwall@apache.org>

* Document the existing behaviour that the plugin accepts a check-interval is a value in seconds.

Signed-off-by: kwall <kwall@apache.org>
(cherry picked from commit 3c968a1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants