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

public Class ReftableConfig

extends Object
Class Inheritance
Static Imports
org.eclipse.jgit.internal.storage.reftable.ReftableConstants.MAX_BLOCK_SIZE

Configuration used by a reftable writer when constructing the stream.

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
ReftableConfig()

Create a default configuration.

public
ReftableConfig(Repository
the repository to read settings from. The repository is not retained by the new configuration, instead its settings are copied during the constructor.
db
)

Create a configuration honoring the repository's settings.

public
ReftableConfig(Config
the source to read settings from. The source is not retained by the new configuration, instead its settings are copied during the constructor.
cfg
)

Create a configuration honoring settings in a org.eclipse.jgit.lib.Config.

public
ReftableConfig(ReftableConfig
the source configuration to copy from.
cfg
)

Copy an existing configuration to a new instance.

Method Summary

Modifier and TypeMethod and Description
public void
fromConfig(Config
configuration to read properties from.
rc
)

Update properties by setting fields from the configuration.

public int

Returns:

desired output block size for log entries, in bytes. If 0 the writer will default to 2 * getRefBlockSize().
getLogBlockSize
()

Get desired output block size for log entries, in bytes.

public int

Returns:

maximum depth of the index; 0 for unlimited.
getMaxIndexLevels
()

Get maximum depth of the index; 0 for unlimited.

public int

Returns:

desired output block size for references, in bytes.
getRefBlockSize
()

Get desired output block size for references, in bytes.

public int

Returns:

number of references between binary search markers.
getRestartInterval
()

Get number of references between binary search markers.

public boolean

Returns:

true if the writer should align blocks.
isAlignBlocks
()

Whether the writer should align blocks.

public boolean

Returns:

true if the writer should index object to ref.
isIndexObjects
()

Whether the writer should index object to ref.

public void
setAlignBlocks(boolean
if true blocks are written aligned to multiples of getRefBlockSize(). May increase file size due to NUL padding bytes added between blocks. Default is true.
align
)

Whether blocks are written aligned to multiples of getRefBlockSize().

public void
setIndexObjects(boolean
if true the reftable may include additional storage to efficiently map from ObjectId to reference names. By default, true.
index
)

Whether the reftable may include additional storage to efficiently map from ObjectId to reference names.

public void
setLogBlockSize(int
desired output block size for log entries, in bytes. If 0 will default to 2 * getRefBlockSize().
szBytes
)

Set desired output block size for log entries, in bytes.

public void
setMaxIndexLevels(int
maximum number of levels to use in indexes. Lower levels of the index respect getRefBlockSize(), and the highest level may exceed that if the number of levels is limited.
levels
)

Set maximum number of levels to use in indexes.

public void
setRefBlockSize(int
desired output block size for references, in bytes.
szBytes
)

Set desired output block size for references, in bytes.

public void
setRestartInterval(int
number of references between binary search markers. If interval is 0 (default), the writer will select a default value based on the block size.
interval
)

Setter for the field restartInterval.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alignBlocksback to summary
private boolean alignBlocks
indexObjectsback to summary
private boolean indexObjects
logBlockSizeback to summary
private int logBlockSize
maxIndexLevelsback to summary
private int maxIndexLevels
refBlockSizeback to summary
private int refBlockSize
restartIntervalback to summary
private int restartInterval

Constructor Detail

ReftableConfigback to summary
public ReftableConfig()

Create a default configuration.

ReftableConfigback to summary
public ReftableConfig(Repository db)

Create a configuration honoring the repository's settings.

Parameters
db:Repository

the repository to read settings from. The repository is not retained by the new configuration, instead its settings are copied during the constructor.

ReftableConfigback to summary
public ReftableConfig(Config cfg)

Create a configuration honoring settings in a org.eclipse.jgit.lib.Config.

Parameters
cfg:Config

the source to read settings from. The source is not retained by the new configuration, instead its settings are copied during the constructor.

ReftableConfigback to summary
public ReftableConfig(ReftableConfig cfg)

Copy an existing configuration to a new instance.

Parameters
cfg:ReftableConfig

the source configuration to copy from.

Method Detail

fromConfigback to summary
public void fromConfig(Config rc)

Update properties by setting fields from the configuration. If a property's corresponding variable is not defined in the supplied configuration, then it is left unmodified.

Parameters
rc:Config

configuration to read properties from.

getLogBlockSizeback to summary
public int getLogBlockSize()

Get desired output block size for log entries, in bytes.

Returns:int

desired output block size for log entries, in bytes. If 0 the writer will default to 2 * getRefBlockSize().

getMaxIndexLevelsback to summary
public int getMaxIndexLevels()

Get maximum depth of the index; 0 for unlimited.

Returns:int

maximum depth of the index; 0 for unlimited.

getRefBlockSizeback to summary
public int getRefBlockSize()

Get desired output block size for references, in bytes.

Returns:int

desired output block size for references, in bytes.

getRestartIntervalback to summary
public int getRestartInterval()

Get number of references between binary search markers.

Returns:int

number of references between binary search markers.

isAlignBlocksback to summary
public boolean isAlignBlocks()

Whether the writer should align blocks.

Returns:boolean

true if the writer should align blocks.

isIndexObjectsback to summary
public boolean isIndexObjects()

Whether the writer should index object to ref.

Returns:boolean

true if the writer should index object to ref.

setAlignBlocksback to summary
public void setAlignBlocks(boolean align)

Whether blocks are written aligned to multiples of getRefBlockSize().

Parameters
align:boolean

if true blocks are written aligned to multiples of getRefBlockSize(). May increase file size due to NUL padding bytes added between blocks. Default is true.

setIndexObjectsback to summary
public void setIndexObjects(boolean index)

Whether the reftable may include additional storage to efficiently map from ObjectId to reference names.

Parameters
index:boolean

if true the reftable may include additional storage to efficiently map from ObjectId to reference names. By default, true.

setLogBlockSizeback to summary
public void setLogBlockSize(int szBytes)

Set desired output block size for log entries, in bytes.

Parameters
szBytes:int

desired output block size for log entries, in bytes. If 0 will default to 2 * getRefBlockSize().

setMaxIndexLevelsback to summary
public void setMaxIndexLevels(int levels)

Set maximum number of levels to use in indexes.

Parameters
levels:int

maximum number of levels to use in indexes. Lower levels of the index respect getRefBlockSize(), and the highest level may exceed that if the number of levels is limited.

setRefBlockSizeback to summary
public void setRefBlockSize(int szBytes)

Set desired output block size for references, in bytes.

Parameters
szBytes:int

desired output block size for references, in bytes.

setRestartIntervalback to summary
public void setRestartInterval(int interval)

Setter for the field restartInterval.

Parameters
interval:int

number of references between binary search markers. If interval is 0 (default), the writer will select a default value based on the block size.