org.eclipse.jgit.storage.dht
Class DhtInserterOptions

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

public class DhtInserterOptions
extends java.lang.Object

Options controlling how objects are inserted into 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
DhtInserterOptions()
          Create a default inserter configuration.
 
Method Summary
 DhtInserterOptions fromConfig(Config rc)
          Update properties by setting fields from the configuration.
 int getChunkSize()
           
 int getCompression()
           
 int getMaxObjectCount()
           
 long getParserCacheLimit()
           
 int getParserCacheSize()
          Number of chunks the parser can cache for delta resolution support.
 int getPrefetchDepth()
          Maximum number of entries in a chunk's prefetch list.
 int getWriteBufferSize()
           
 DhtInserterOptions setChunkSize(int sizeInBytes)
          Set the maximum size of a chunk, in bytes.
 DhtInserterOptions setCompression(int level)
          Set the compression level used when writing new objects.
 DhtInserterOptions setParserCacheLimit(long limit)
          Set the number of bytes the PackParser can cache.
 DhtInserterOptions setPrefetchDepth(int depth)
          Maximum number of entries in a chunk's prefetch list.
 DhtInserterOptions setWriteBufferSize(int sizeInBytes)
          Set the maximum number of outstanding bytes in a WriteBuffer.
 
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

DhtInserterOptions

public DhtInserterOptions()
Create a default inserter configuration.

Method Detail

getChunkSize

public int getChunkSize()
Returns:
maximum size of a chunk, in bytes.

setChunkSize

public DhtInserterOptions setChunkSize(int sizeInBytes)
Set the maximum size of a chunk, in bytes.

Parameters:
sizeInBytes - the maximum size. A chunk's data segment won't exceed this.
Returns:
this

getWriteBufferSize

public int getWriteBufferSize()
Returns:
maximum number of outstanding write bytes.

setWriteBufferSize

public DhtInserterOptions setWriteBufferSize(int sizeInBytes)
Set the maximum number of outstanding bytes in a WriteBuffer.

Parameters:
sizeInBytes - maximum number of bytes.
Returns:
this

getMaxObjectCount

public int getMaxObjectCount()
Returns:
maximum number of objects to put into a chunk.

getCompression

public int getCompression()
Returns:
compression level used when writing new objects into chunks.

setCompression

public DhtInserterOptions setCompression(int level)
Set the compression level used when writing new objects.

Parameters:
level - the compression level. Use Deflater.DEFAULT_COMPRESSION to specify a default compression setting.
Returns:
this

getPrefetchDepth

public int getPrefetchDepth()
Maximum number of entries in a chunk's prefetch list.

Each commit or tree chunk stores an optional prefetch list containing the next X chunk keys that a reader would need if they were traversing the project history. This implies that chunk prefetch lists are overlapping.

The depth at insertion time needs to be deep enough to allow readers to have sufficient parallel prefetch to keep themselves busy without waiting on sequential loads. If the depth is not sufficient, readers will stall while they sequentially look up the next chunk they need.

Returns:
maximum number of entries in a GitStore.ChunkMeta list.

setPrefetchDepth

public DhtInserterOptions setPrefetchDepth(int depth)
Maximum number of entries in a chunk's prefetch list.

Parameters:
depth - maximum depth of the prefetch list.
Returns:
this

getParserCacheSize

public int getParserCacheSize()
Number of chunks the parser can cache for delta resolution support.

Returns:
chunks to hold in memory to support delta resolution.

getParserCacheLimit

public long getParserCacheLimit()
Returns:
number of bytes the PackParser can cache for delta resolution.

setParserCacheLimit

public DhtInserterOptions setParserCacheLimit(long limit)
Set the number of bytes the PackParser can cache.

Parameters:
limit - number of bytes the parser can cache.
Returns:
this

fromConfig

public DhtInserterOptions 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.