[dvc][server][controller][router] Removed Optional from Store API
The Store::getVersion API used to return an Optional<Version>, now it instead returns a @Nullable Version. Also added a getVersionOrThrow API which can throw StoreVersionNotFoundException, a new exception type.
Lots of refactoring to adapt to the change, though these should be non-functional changes.
Significant changes:
-
Some usages of getVersion in the consumer client were doing naked .get() so these have been replaced by getVersionOrThrow.
-
Refactored the HelixCustomizedViewOfflinePushRepository to make all changes to the resourceToPartitionCountMap go through fewer private functions, and fixed some naked .get() bug there as well.
Miscellaneous main code changes:
- Deleted the ExpiringSet and its usage in ReadQuotaEnforcementHandler.
Miscellaneous test code changes:
-
Removed nearly all mocking of the deprecated function PubSubProducerAdapter::getNumberOfPartitions and replaced it with VeniceWriterOptions::setPartitionCount.
-
Added timeouts to all TestVeniceHelixAdminWithSharedEnvironment tests.
-
Added the ability to override the duration of some long operations in HelixReadOnlySchemaRepository and PubSubConstants, only for tests. This reduces venice-common unit tests by ~6 minutes.
How was this PR tested?
GHCI.
Does this PR introduce any user-facing changes?
- [x] No. You can skip the rest of this section.
- [ ] Yes. Make sure to explain your proposed changes and call out the behavior change.