Top Description Fields Constructors Methods
org.eclipse.jgit.internal.storage.dfs

public Class DfsReaderOptions

extends Object
Class Inheritance
Static Imports
org.eclipse.jgit.lib.ConfigConstants.CONFIG_CORE_SECTION, .ConfigConstants.CONFIG_DFS_SECTION, .ConfigConstants.CONFIG_KEY_DELTA_BASE_CACHE_LIMIT, .ConfigConstants.CONFIG_KEY_LOAD_REV_INDEX_IN_PARALLEL, .ConfigConstants.CONFIG_KEY_STREAM_BUFFER, .ConfigConstants.CONFIG_KEY_STREAM_FILE_THRESHOLD, .ConfigConstants.CONFIG_KEY_USE_OBJECT_SIZE_INDEX

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

Field Summary

Modifier and TypeField and Description
private int
public static final int
KiB

1024 (number of bytes in one kibibyte/kilobyte)

private boolean
public static final int
MiB

1024 KiB (number of bytes in one mebibyte/megabyte)

private int
private int
private boolean

Constructor Summary

AccessConstructor and Description
public
DfsReaderOptions()

Create a default reader configuration.

Method Summary

Modifier and TypeMethod and Description
public DfsReaderOptions

Returns:

this
fromConfig
(Config
configuration to read properties from.
rc
)

Update properties by setting fields from the configuration.

public int

Returns:

maximum number of bytes to hold in per-reader DeltaBaseCache.
getDeltaBaseCacheLimit
()

Get maximum number of bytes to hold in per-reader DeltaBaseCache.

public int

Returns:

the size threshold beyond which objects must be streamed.
getStreamFileThreshold
()

Get the size threshold beyond which objects must be streamed.

public int

Returns:

number of bytes to use for buffering when streaming a pack file during copying. If 0 the block size of the pack is used.
getStreamPackBufferSize
()

Get number of bytes to use for buffering when streaming a pack file during copying.

public DfsReaderOptions

Returns:

this
setDeltaBaseCacheLimit
(int
the new limit.
maxBytes
)

Set the maximum number of bytes in the DeltaBaseCache.

public DfsReaderOptions

Returns:

this
setLoadRevIndexInParallel
(boolean
whether to load reverse index in parallel.
loadRevIndexInParallel
)

Enable (or disable) parallel loading of reverse index.

public DfsReaderOptions

Returns:

this
setStreamFileThreshold
(int
new byte limit for objects that must be streamed. Objects smaller than this size can be obtained as a contiguous byte array, while objects bigger than this size require using an org.eclipse.jgit.lib.ObjectStream.
newLimit
)

Set new byte limit for objects that must be streamed.

public DfsReaderOptions

Returns:

this
setStreamPackBufferSize
(int
new buffer size in bytes for buffers used when streaming pack files during copying.
bufsz
)

Set new buffer size in bytes for buffers used when streaming pack files during copying.

public DfsReaderOptions

Returns:

this
setUseObjectSizeIndex
(boolean
true to use it, false to ignore the object size index
useObjectSizeIndex
)

Set if the reader should try to use the object size index

public boolean

Returns:

true if reverse index is loaded in parallel for bitmap index.
shouldLoadRevIndexInParallel
()

Check if reverse index should be loaded in parallel.

public boolean

Returns:

true if the reader should try to use the object size index. if false, the reader ignores that index.
shouldUseObjectSizeIndex
()

Use the object size index if available.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

deltaBaseCacheLimitback to summary
private int deltaBaseCacheLimit
KiBback to summary
public static final int KiB

1024 (number of bytes in one kibibyte/kilobyte)

loadRevIndexInParallelback to summary
private boolean loadRevIndexInParallel
MiBback to summary
public static final int MiB

1024 KiB (number of bytes in one mebibyte/megabyte)

streamFileThresholdback to summary
private int streamFileThreshold
streamPackBufferSizeback to summary
private int streamPackBufferSize
useObjectSizeIndexback to summary
private boolean useObjectSizeIndex

Constructor Detail

DfsReaderOptionsback to summary
public DfsReaderOptions()

Create a default reader configuration.

Method Detail

fromConfigback to summary
public DfsReaderOptions 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:Config

configuration to read properties from.

Returns:DfsReaderOptions

this

getDeltaBaseCacheLimitback to summary
public int getDeltaBaseCacheLimit()

Get maximum number of bytes to hold in per-reader DeltaBaseCache.

Returns:int

maximum number of bytes to hold in per-reader DeltaBaseCache.

getStreamFileThresholdback to summary
public int getStreamFileThreshold()

Get the size threshold beyond which objects must be streamed.

Returns:int

the size threshold beyond which objects must be streamed.

getStreamPackBufferSizeback to summary
public int getStreamPackBufferSize()

Get number of bytes to use for buffering when streaming a pack file during copying.

Returns:int

number of bytes to use for buffering when streaming a pack file during copying. If 0 the block size of the pack is used.

setDeltaBaseCacheLimitback to summary
public DfsReaderOptions setDeltaBaseCacheLimit(int maxBytes)

Set the maximum number of bytes in the DeltaBaseCache.

Parameters
maxBytes:int

the new limit.

Returns:DfsReaderOptions

this

setLoadRevIndexInParallelback to summary
public DfsReaderOptions setLoadRevIndexInParallel(boolean loadRevIndexInParallel)

Enable (or disable) parallel loading of reverse index.

Parameters
loadRevIndexInParallel:boolean

whether to load reverse index in parallel.

Returns:DfsReaderOptions

this

setStreamFileThresholdback to summary
public DfsReaderOptions setStreamFileThreshold(int newLimit)

Set new byte limit for objects that must be streamed.

Parameters
newLimit:int

new byte limit for objects that must be streamed. Objects smaller than this size can be obtained as a contiguous byte array, while objects bigger than this size require using an org.eclipse.jgit.lib.ObjectStream.

Returns:DfsReaderOptions

this

setStreamPackBufferSizeback to summary
public DfsReaderOptions setStreamPackBufferSize(int bufsz)

Set new buffer size in bytes for buffers used when streaming pack files during copying.

Parameters
bufsz:int

new buffer size in bytes for buffers used when streaming pack files during copying.

Returns:DfsReaderOptions

this

setUseObjectSizeIndexback to summary
public DfsReaderOptions setUseObjectSizeIndex(boolean useObjectSizeIndex)

Set if the reader should try to use the object size index

Parameters
useObjectSizeIndex:boolean

true to use it, false to ignore the object size index

Returns:DfsReaderOptions

this

shouldLoadRevIndexInParallelback to summary
public boolean shouldLoadRevIndexInParallel()

Check if reverse index should be loaded in parallel.

Returns:boolean

true if reverse index is loaded in parallel for bitmap index.

shouldUseObjectSizeIndexback to summary
public boolean shouldUseObjectSizeIndex()

Use the object size index if available.

Returns:boolean

true if the reader should try to use the object size index. if false, the reader ignores that index.