org.eclipse.jgit.storage.dht
Class DhtReaderOptions

java.lang.Object
  extended by org.eclipse.jgit.storage.dht.DhtReaderOptions

public class DhtReaderOptions
extends java.lang.Object

Options controlling how objects are read from a DHT stored repository.


Field Summary
static int KiB
          1024 (number of bytes in one kibibyte/kilobyte)
static int MiB
          1024 KiB (number of bytes in one mebibyte/megabyte)
 
Constructor Summary
DhtReaderOptions()
          Create a default reader configuration.
 
Method Summary
 DhtReaderOptions fromConfig(Config rc)
          Update properties by setting fields from the configuration.
 int getChunkLimit()
           
 int getDeltaBaseCacheLimit()
           
 int getDeltaBaseCacheSize()
           
 int getObjectIndexBatchSize()
           
 int getObjectIndexConcurrentBatches()
           
 int getOpenQueuePrefetchRatio()
           
 int getRecentInfoCacheSize()
           
 Timeout getTimeout()
           
 int getWalkCommitsPrefetchRatio()
           
 int getWalkTreesPrefetchRatio()
           
 int getWriteObjectsPrefetchRatio()
           
 boolean isPrefetchFollowEdgeHints()
           
 boolean isTrackFirstChunkLoad()
           
 DhtReaderOptions setChunkLimit(int maxBytes)
          Set the number of bytes hold within a DhtReader.
 DhtReaderOptions setDeltaBaseCacheLimit(int maxBytes)
          Set the maximum number of bytes in the DeltaBaseCache.
 DhtReaderOptions setDeltaBaseCacheSize(int slotCnt)
          Set the size of the delta base cache hash table.
 DhtReaderOptions setObjectIndexBatchSize(int objectCnt)
          Set the number of objects to lookup at once.
 DhtReaderOptions setObjectIndexConcurrentBatches(int batches)
          Set the number of concurrent readers on ObjectIndexTable.
 DhtReaderOptions setOpenQueuePrefetchRatio(int ratio)
          Set the prefetch ratio used by the open object queue.
 DhtReaderOptions setPrefetchFollowEdgeHints(boolean follow)
          Enable (or disable) the experimental edge following feature.
 DhtReaderOptions setRecentInfoCacheSize(int objectCnt)
          Set the number of objects to cache information on.
 DhtReaderOptions setTimeout(Timeout maxWaitTime)
          Set the default timeout to wait on long operations.
 DhtReaderOptions setTrackFirstChunkLoad(boolean track)
          Set whether or not the initial load of each chunk should be tracked.
 DhtReaderOptions setWalkCommitsPrefetchRatio(int ratio)
          Set the prefetch ratio used by the open object queue.
 DhtReaderOptions setWalkTreesPrefetchRatio(int ratio)
          Set the prefetch ratio used by the open object queue.
 DhtReaderOptions setWriteObjectsPrefetchRatio(int ratio)
          Set the prefetch ratio used by the open object queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KiB

public static final int KiB
1024 (number of bytes in one kibibyte/kilobyte)

See Also:
Constant Field Values

MiB

public static final int MiB
1024 KiB (number of bytes in one mebibyte/megabyte)

See Also:
Constant Field Values
Constructor Detail

DhtReaderOptions

public DhtReaderOptions()
Create a default reader configuration.

Method Detail

getTimeout

public Timeout getTimeout()
Returns:
default timeout to wait on long operations before aborting.

setTimeout

public DhtReaderOptions setTimeout(Timeout maxWaitTime)
Set the default timeout to wait on long operations.

Parameters:
maxWaitTime - new wait time.
Returns:
this

isPrefetchFollowEdgeHints

public boolean isPrefetchFollowEdgeHints()
Returns:
if the prefetcher should follow edge hints (experimental)

setPrefetchFollowEdgeHints

public DhtReaderOptions setPrefetchFollowEdgeHints(boolean follow)
Enable (or disable) the experimental edge following feature.

Parameters:
follow - true to follow the edge hints.
Returns:
this

getChunkLimit

public int getChunkLimit()
Returns:
number of bytes to hold within a DhtReader.

setChunkLimit

public DhtReaderOptions setChunkLimit(int maxBytes)
Set the number of bytes hold within a DhtReader.

Parameters:
maxBytes -
Returns:
this

getOpenQueuePrefetchRatio

public int getOpenQueuePrefetchRatio()
Returns:
percentage of getChunkLimit() used for prefetch, 0..100.

setOpenQueuePrefetchRatio

public DhtReaderOptions setOpenQueuePrefetchRatio(int ratio)
Set the prefetch ratio used by the open object queue.

Parameters:
ratio - 0..100.
Returns:
this

getWalkCommitsPrefetchRatio

public int getWalkCommitsPrefetchRatio()
Returns:
percentage of getChunkLimit() used for prefetch, 0..100.

setWalkCommitsPrefetchRatio

public DhtReaderOptions setWalkCommitsPrefetchRatio(int ratio)
Set the prefetch ratio used by the open object queue.

Parameters:
ratio - 0..100.
Returns:
this

getWalkTreesPrefetchRatio

public int getWalkTreesPrefetchRatio()
Returns:
percentage of getChunkLimit() used for prefetch, 0..100.

setWalkTreesPrefetchRatio

public DhtReaderOptions setWalkTreesPrefetchRatio(int ratio)
Set the prefetch ratio used by the open object queue.

Parameters:
ratio - 0..100.
Returns:
this

getWriteObjectsPrefetchRatio

public int getWriteObjectsPrefetchRatio()
Returns:
percentage of getChunkLimit() used for prefetch, 0..100.

setWriteObjectsPrefetchRatio

public DhtReaderOptions setWriteObjectsPrefetchRatio(int ratio)
Set the prefetch ratio used by the open object queue.

Parameters:
ratio - 0..100.
Returns:
this

getObjectIndexConcurrentBatches

public int getObjectIndexConcurrentBatches()
Returns:
number of concurrent reads against ObjectIndexTable.

setObjectIndexConcurrentBatches

public DhtReaderOptions setObjectIndexConcurrentBatches(int batches)
Set the number of concurrent readers on ObjectIndexTable.

Parameters:
batches - number of batches.
Returns:
this

getObjectIndexBatchSize

public int getObjectIndexBatchSize()
Returns:
number of objects to lookup in one batch.

setObjectIndexBatchSize

public DhtReaderOptions setObjectIndexBatchSize(int objectCnt)
Set the number of objects to lookup at once.

Parameters:
objectCnt - the number of objects in a lookup batch.
Returns:
this

getDeltaBaseCacheSize

public int getDeltaBaseCacheSize()
Returns:
size of the delta base cache hash table, in object entries.

setDeltaBaseCacheSize

public DhtReaderOptions setDeltaBaseCacheSize(int slotCnt)
Set the size of the delta base cache hash table.

Parameters:
slotCnt - number of slots in the hash table.
Returns:
this

getDeltaBaseCacheLimit

public int getDeltaBaseCacheLimit()
Returns:
maximum number of bytes to hold in per-reader DeltaBaseCache.

setDeltaBaseCacheLimit

public DhtReaderOptions setDeltaBaseCacheLimit(int maxBytes)
Set the maximum number of bytes in the DeltaBaseCache.

Parameters:
maxBytes - the new limit.
Returns:
this

getRecentInfoCacheSize

public int getRecentInfoCacheSize()
Returns:
number of objects to cache information on.

setRecentInfoCacheSize

public DhtReaderOptions setRecentInfoCacheSize(int objectCnt)
Set the number of objects to cache information on.

Parameters:
objectCnt - the number of objects to cache.
Returns:
this

isTrackFirstChunkLoad

public boolean isTrackFirstChunkLoad()
Returns:
true if DhtReader.Statistics includes the stack trace for the first time a chunk is loaded. Supports debugging DHT code.

setTrackFirstChunkLoad

public DhtReaderOptions setTrackFirstChunkLoad(boolean track)
Set whether or not the initial load of each chunk should be tracked.

Parameters:
track - true to track the stack trace of the first load.
Returns:
this.

fromConfig

public DhtReaderOptions 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 © 2011. All Rights Reserved.