org.eclipse.jgit.storage.dfs
Class DfsBlockCacheConfig

java.lang.Object
  extended by org.eclipse.jgit.storage.dfs.DfsBlockCacheConfig

public class DfsBlockCacheConfig
extends Object

Configuration parameters for DfsBlockCache.


Field Summary
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
DfsBlockCacheConfig()
          Create a default configuration.
 
Method Summary
 DfsBlockCacheConfig fromConfig(Config rc)
          Update properties by setting fields from the configuration.
 long getBlockLimit()
           
 int getBlockSize()
           
 int getReadAheadLimit()
           
 ThreadPoolExecutor getReadAheadService()
           
 DfsBlockCacheConfig setBlockLimit(long newLimit)
           
 DfsBlockCacheConfig setBlockSize(int newSize)
           
 DfsBlockCacheConfig setReadAheadLimit(int newSize)
           
 DfsBlockCacheConfig setReadAheadService(ThreadPoolExecutor svc)
           
 
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

getReadAheadLimit

public int getReadAheadLimit()
Returns:
number of bytes to read ahead sequentially by.

setReadAheadLimit

public DfsBlockCacheConfig setReadAheadLimit(int newSize)
Parameters:
newSize - new read-ahead limit, in bytes.
Returns:
this

getReadAheadService

public ThreadPoolExecutor getReadAheadService()
Returns:
service to perform read-ahead of sequential blocks.

setReadAheadService

public DfsBlockCacheConfig setReadAheadService(ThreadPoolExecutor svc)
Parameters:
svc - service to perform read-ahead of sequential blocks with. If not null the RejectedExecutionHandler must be managed by the JGit DFS library and not the application.
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


Copyright © 2012. All Rights Reserved.