org.eclipse.jgit.internal.storage.dfs.DfsBlockCache .
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | DfsBlockCacheConfig.
A configuration for a single cache table storing 1 or more Pack extensions. |
| public static interface | DfsBlockCacheConfig.
Consumer of DfsBlockCache loading and eviction events for indexes. |
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private int | |
| private Map | |
| private int | |
| public static final int | DEFAULT_CACHE_HOT_MAX
Default number of max cache hits. |
| pack-priv static final String | |
| private DfsBlockCacheConfig. | |
| public static final int | KB
1024 (number of bytes in one kibibyte/kilobyte) |
| public static final int | |
| private String | |
| private List | |
| private Consumer | |
| private double |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public DfsBlockCacheConfig | Returns: thisconfiguration to read properties from. rc)Update properties by setting fields from the configuration. |
| private void | |
| public long | Returns: maximum number bytes of heap memory to dedicate to caching pack file data. Default is 32 MB.Get maximum number bytes of heap memory to dedicate to caching pack file data. |
| public int | Returns: size in bytes of a single window mapped or read in from the pack file. Default is 64 KB.Get size in bytes of a single window mapped or read in from the pack file. |
| public Map | Returns: map of hot count per pack extension forDfsBlockCache.Get the map of hot count per pack extension for |
| public int | Returns: the estimated number of threads concurrently accessing the cache. Default is 32.Get the estimated number of threads concurrently accessing the cache. |
| public DfsBlockCacheConfig. | Returns: consumer of cache index events.Get the consumer of cache index events. |
| public String | Returns: the name for the block cache configured by this cache config.Get the name for the block cache configured by this cache config. |
| pack-priv List | Returns: the list of pack ext cache configs.Get the list of pack ext cache configs. |
| public Consumer | Returns: consumer of wait time in milliseconds.Get the consumer of the object reference lock wait time in milliseconds. |
| public double | Returns: highest percentage ofgetBlockLimit() a single pack can
occupy while being copied by the pack reuse strategy. Default
is 0.30, or 30%.Get highest percentage of |
| private static <T> Set | |
| private void | |
| public void | print(PrintWriter
PrintWriter to write the cache's configuration to.Print the current cache configuration to the given |
| private void | print(String
prefix to prepend all writen lines with. Ex a string of 0 or
more " " entries. linePrefix, String filler used to extend linePrefix. Ex a multiple of " ". pad, PrintWriter PrintWriter to write the cache's configuration to.Print the current cache configuration to the given |
| public DfsBlockCacheConfig | Returns: thismaximum number bytes of heap memory to dedicate to caching
pack file data; must be positive. newLimit)Set maximum number bytes of heap memory to dedicate to caching pack file data. |
| public DfsBlockCacheConfig | Returns: thissize in bytes of a single window read in from the pack file.
The value must be a power of 2. newSize)Set size in bytes of a single window read in from the pack file. |
| public DfsBlockCacheConfig | Returns: thismap of hot count per pack extension for cacheHotMap)DfsBlockCache.Set the map of hot count per pack extension for |
| private void | |
| public DfsBlockCacheConfig | Returns: thisthe estimated number of threads concurrently accessing the
cache. newConcurrencyLevel)Set the estimated number of threads concurrently accessing the cache. |
| public DfsBlockCacheConfig | Returns: thisconsumer of cache index events. indexEventConsumerSet the consumer of cache index events. |
| pack-priv DfsBlockCacheConfig | |
| pack-priv DfsBlockCacheConfig | Returns: thisthe list of pack ext cache configs to set. packExtCacheConfigurationsSet the list of pack ext cache configs. |
| public DfsBlockCacheConfig | Returns: thisconsumer of wait time in milliseconds. c)Set the consumer for lock wait time. |
| public DfsBlockCacheConfig | Returns: thispercentage of cache to occupy with a copied pack. ratio)Set percentage of cache to occupy with a copied pack. |
| blockLimit | back to summary |
|---|---|
| private long blockLimit | |
| blockSize | back to summary |
|---|---|
| private int blockSize | |
| cacheHotMap | back to summary |
|---|---|
| private Map<PackExt, Integer> cacheHotMap | |
| concurrencyLevel | back to summary |
|---|---|
| private int concurrencyLevel | |
| DEFAULT_CACHE_HOT_MAX | back to summary |
|---|---|
| public static final int DEFAULT_CACHE_HOT_MAX Default number of max cache hits. | |
| DEFAULT_NAME | back to summary |
|---|---|
| pack-priv static final String DEFAULT_NAME | |
| indexEventConsumer | back to summary |
|---|---|
| private DfsBlockCacheConfig. | |
| KB | back to summary |
|---|---|
| public static final int KB 1024 (number of bytes in one kibibyte/kilobyte) | |
| MB | back to summary |
|---|---|
| public static final int MB 1024 | |
| name | back to summary |
|---|---|
| private String name | |
| packExtCacheConfigurations | back to summary |
|---|---|
| private List<DfsBlockCacheConfig. | |
| refLock | back to summary |
|---|---|
| private Consumer<Long> refLock | |
| streamRatio | back to summary |
|---|---|
| private double streamRatio | |
| DfsBlockCacheConfig | back to summary |
|---|---|
| public DfsBlockCacheConfig() Create a default configuration. | |
| fromConfig | back to summary |
|---|---|
| public DfsBlockCacheConfig fromConfig(Config rc) Update properties by setting fields from the configuration. If a property is not defined in the configuration, then it is left unmodified. Enforces certain constraints on the combination of settings in the config, for example that the block limit is a multiple of the block size.
| |
| fromConfig | back to summary |
|---|---|
| private void fromConfig(String section, String subSection, Config rc) | |
| getBlockLimit | back to summary |
|---|---|
| public long getBlockLimit() Get maximum number bytes of heap memory to dedicate to caching pack file data.
| |
| getBlockSize | back to summary |
|---|---|
| public int getBlockSize() Get size in bytes of a single window mapped or read in from the pack file.
| |
| getCacheHotMap | back to summary |
|---|---|
| public Map Get the map of hot count per pack extension for | |
| getConcurrencyLevel | back to summary |
|---|---|
| public int getConcurrencyLevel() Get the estimated number of threads concurrently accessing the cache.
| |
| getIndexEventConsumer | back to summary |
|---|---|
| public DfsBlockCacheConfig. Get the consumer of cache index events.
| |
| getName | back to summary |
|---|---|
| public String getName() Get the name for the block cache configured by this cache config.
| |
| getPackExtCacheConfigurations | back to summary |
|---|---|
| pack-priv List Get the list of pack ext cache configs.
| |
| getRefLockWaitTimeConsumer | back to summary |
|---|---|
| public Consumer Get the consumer of the object reference lock wait time in milliseconds. | |
| getStreamRatio | back to summary |
|---|---|
| public double getStreamRatio() Get highest percentage of
| |
| intersection | back to summary |
|---|---|
| private static <T> Set | |
| loadPackExtConfigs | back to summary |
|---|---|
| private void loadPackExtConfigs(Config config) | |
| back to summary | |
|---|---|
| public void print(PrintWriter writer) Print the current cache configuration to the given
| |
| back to summary | |
|---|---|
| private void print(String linePrefix, String pad, PrintWriter writer) Print the current cache configuration to the given
| |
| setBlockLimit | back to summary |
|---|---|
| public DfsBlockCacheConfig setBlockLimit(long newLimit) Set maximum number bytes of heap memory to dedicate to caching pack file data.
It is strongly recommended to set the block limit to be an integer
multiple of the block size. This constraint is not enforced by this
method (since it may be called before
| |
| setBlockSize | back to summary |
|---|---|
| public DfsBlockCacheConfig setBlockSize(int newSize) Set size in bytes of a single window read in from the pack file.
| |
| setCacheHotMap | back to summary |
|---|---|
| public DfsBlockCacheConfig setCacheHotMap(Map<PackExt, Integer> cacheHotMap) Set the map of hot count per pack extension for
| |
| setCacheHotMapToPackExtConfigs | back to summary |
|---|---|
| private void setCacheHotMapToPackExtConfigs(Map<PackExt, Integer> cacheHotMap) | |
| setConcurrencyLevel | back to summary |
|---|---|
| public DfsBlockCacheConfig setConcurrencyLevel(final int newConcurrencyLevel) Set the estimated number of threads concurrently accessing the cache.
| |
| setIndexEventConsumer | back to summary |
|---|---|
| public DfsBlockCacheConfig setIndexEventConsumer(DfsBlockCacheConfig. Set the consumer of cache index events.
| |
| setName | back to summary |
|---|---|
| pack-priv DfsBlockCacheConfig setName(String name) Set the name for the block cache configured by this cache config. Made visible for testing.
| |
| setPackExtCacheConfigurations | back to summary |
|---|---|
| pack-priv DfsBlockCacheConfig setPackExtCacheConfigurations(List<DfsBlockCacheConfig. Set the list of pack ext cache configs. Made visible for testing.
| |
| setRefLockWaitTimeConsumer | back to summary |
|---|---|
| public DfsBlockCacheConfig setRefLockWaitTimeConsumer(Consumer<Long> c) Set the consumer for lock wait time.
| |
| setStreamRatio | back to summary |
|---|---|
| public DfsBlockCacheConfig setStreamRatio(double ratio) Set percentage of cache to occupy with a copied pack.
| |
The current pack ext cache tables implementation supports the same parameters the ClockBlockCacheTable (current default implementation).
Configuration falls back to the defaults coded values defined in the
DfsBlockCacheConfig when not set on each cache table
configuration and NOT the values of the basic dfs section.
Format:
[core "dfs.packCache"]
packExtensions = "PACK"
blockSize = 512
blockLimit = 100
concurrencyLevel = 5
[core "dfs.multipleExtensionCache"]
packExtensions = "INDEX REFTABLE BITMAP_INDEX"
blockSize = 512
blockLimit = 100
concurrencyLevel = 5
| Modifier and Type | Field and Description |
|---|---|
| private final DfsBlockCacheConfig | |
| private final EnumSet |
| Access | Constructor and Description |
|---|---|
| pack-priv | DfsBlockCachePackExtConfig(EnumSet<PackExt>
Set of packExts, DfsBlockCacheConfig PackExts associated to this cache config.DfsBlockCacheConfig for this cache config.Made visible for testing. |
| Modifier and Type | Method and Description |
|---|---|
| private static DfsBlockCacheConfig. | |
| pack-priv DfsBlockCacheConfig | |
| pack-priv Set | |
| pack-priv void | |
| pack-priv void |
| packExtCacheConfiguration | back to summary |
|---|---|
| private final DfsBlockCacheConfig packExtCacheConfiguration | |
| packExts | back to summary |
|---|---|
| private final EnumSet<PackExt> packExts | |
| DfsBlockCachePackExtConfig | back to summary |
|---|---|
| pack-priv DfsBlockCachePackExtConfig(EnumSet<PackExt> packExts, DfsBlockCacheConfig packExtCacheConfiguration) Made visible for testing.
| |
| fromConfig | back to summary |
|---|---|
| private static DfsBlockCacheConfig. | |
| getPackExtCacheConfiguration | back to summary |
|---|---|
| pack-priv DfsBlockCacheConfig getPackExtCacheConfiguration() | |
| getPackExts | back to summary |
|---|---|
| pack-priv Set | |
| back to summary | |
|---|---|
| pack-priv void print(String linePrefix, String pad, PrintWriter writer) | |
| setCacheHotMap | back to summary |
|---|---|
| pack-priv void setCacheHotMap(Map<PackExt, Integer> cacheHotMap) | |
| Modifier and Type | Method and Description |
|---|---|
| public default void | acceptEvictedEvent(int
position in packExtPos, long PackExt enumnumber of bytes evicted bytes, int number of times an index was accessed while in cache totalCacheHitCount, Duration time since last eviction, 0 if was not evicted yet lastEvictionDuration)Accept an event of an index evicted from cache. |
| public void | acceptRequestedEvent(int
position in packExtPos, boolean PackExt enumtrue if an index was already in cache. Otherwise, the
index was loaded from storage into the cache in the
current request, cacheHit, long time to load an index from cache or storage in
microseconds loadMicros, long number of bytes loaded bytes, Duration time since last eviction, 0 if was not evicted yet lastEvictionDuration)Accept an event of an index requested. |
| public default boolean | Returns: true if reporting evicted events is enabled.Whether evicted events should be reported |
| acceptEvictedEvent | back to summary |
|---|---|
| public default void acceptEvictedEvent(int packExtPos, long bytes, int totalCacheHitCount, Duration lastEvictionDuration) Accept an event of an index evicted from cache.
| |
| acceptRequestedEvent | back to summary |
|---|---|
| public void acceptRequestedEvent(int packExtPos, boolean cacheHit, long loadMicros, long bytes, Duration lastEvictionDuration) Accept an event of an index requested. It could be loaded from either cache or storage.
| |
| shouldReportEvictedEvent | back to summary |
|---|---|
| public default boolean shouldReportEvictedEvent() Whether evicted events should be reported
| |