org.eclipse.jgit.internal.storage.dfs

## Class DfsBlockCacheConfig

- java.lang.Object
- - org.eclipse.jgit.internal.storage.dfs.DfsBlockCacheConfig

    public class DfsBlockCacheConfig
    extends Object

Configuration parameters for `DfsBlockCache`.

### Field Summary

Fields
`static int` `KB` 1024 (number of bytes in one kibibyte/kilobyte)
`static int` `MB` 1024 `KB` (number of bytes in one mebibyte/megabyte)

### Constructor Summary

Constructors
Constructor and Description
`DfsBlockCacheConfig()` Create a default configuration.

### Method Summary

Methods
`DfsBlockCacheConfig` `fromConfig(Config rc)` Update properties by setting fields from the configuration.
`long` `getBlockLimit()`
`int` `getBlockSize()`
`DfsBlockCacheConfig` `setBlockLimit(long newLimit)`
`DfsBlockCacheConfig` `setBlockSize(int newSize)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### KB

    public static final int KB

1024 (number of bytes in one kibibyte/kilobyte)

See Also:
  Constant Field Values

#### MB

    public static final int MB

1024 `KB` (number of bytes in one mebibyte/megabyte)

See Also:
  Constant Field Values

### Constructor Detail

#### DfsBlockCacheConfig

    public DfsBlockCacheConfig()

Create a default configuration.

### Method Detail

#### getBlockLimit

    public long getBlockLimit()

Returns:
  maximum number bytes of heap memory to dedicate to caching pack file data. Default is 32 MB.

#### setBlockLimit

    public DfsBlockCacheConfig setBlockLimit(long newLimit)

Parameters:
  `newLimit` - maximum number bytes of heap memory to dedicate to caching pack file data.
Returns:
  `this`

#### getBlockSize

    public int getBlockSize()

Returns:
  size in bytes of a single window mapped or read in from the pack file. Default is 64 KB.

#### setBlockSize

    public DfsBlockCacheConfig setBlockSize(int newSize)

Parameters:
  `newSize` - size in bytes of a single window read in from the pack file.
Returns:
  `this`

#### fromConfig

    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.

Parameters:
  `rc` - configuration to read properties from.
Returns:
  `this`