-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[router] Reduced allocations in router read path
A lot of multi-key specific state was moved out of VenicePath and into its subclasses, which makes single get queries require less heap space. This includes streaming (chunkedResponse), HAR (helixGroupId and requestId), longTailRetryThresholdMs and responseHeaders. In addition, all kinds of VenicePaths are also getting their heap size reduced by leveraging shared instances where possible. For example: - The resourceName, storeName and versionNumber properties are replaced by a single reference to a shared instance of StoreVersionName, which is a new class obtained from a NameRepository. - The smartLongTailRetryEnabled, smartLongTailRetryAbortThresholdMs and longTailRetryThresholdMs properties are replaced by a single pointer to a RouterRetryConfig object, which is a simple facade wrapping the VeniceRouterConfig. - Removed the time property from VenicePath since the only time it is used by tests to inject a MockTime, it is done from a subclass, and therefore can be achieved via extension, rather than composition. - The responseDecompressor is now coming from a map of shared instances in the VenicePathParser. New config: - name.repository.max.entry.count : controls the maximum number of entries (per type) to be cached in the NameRepository class. For now this config is used only in the router, but it would likely become used in the server and controller as well, later on. Miscellaneous: - Various refactorings enable the VenicePath constructors to have fewer params and to make more of the properties final. - Made use of StoreName rather than String in the VenicePathParser's RetryManager maps. - Cleaned up generics in the VenicePathParser and ScatterGatherHelper builder. - Deleted VeniceMetricsProvider which can be trivially inlined.
- Loading branch information
Showing
34 changed files
with
797 additions
and
681 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
services/venice-router/src/main/java/com/linkedin/venice/router/RouterRetryConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.linkedin.venice.router; | ||
|
||
import java.util.TreeMap; | ||
|
||
|
||
/** | ||
* A facade for the {@link VeniceRouterConfig}, so that retry-related configs can be passed around without giving access | ||
* to the rest of the configs. | ||
*/ | ||
public interface RouterRetryConfig { | ||
TreeMap<Integer, Integer> getLongTailRetryForBatchGetThresholdMs(); | ||
|
||
int getLongTailRetryForSingleGetThresholdMs(); | ||
|
||
int getLongTailRetryMaxRouteForMultiKeyReq(); | ||
|
||
int getSmartLongTailRetryAbortThresholdMs(); | ||
|
||
boolean isSmartLongTailRetryEnabled(); | ||
} |
Oops, something went wrong.