Class ReftableConfig
- java.lang.Object
-
- org.eclipse.jgit.internal.storage.reftable.ReftableConfig
-
public class ReftableConfig extends Object
Configuration used by a reftable writer when constructing the stream.
-
-
Constructor Summary
Constructors Constructor Description ReftableConfig()
Create a default configuration.ReftableConfig(ReftableConfig cfg)
Copy an existing configuration to a new instance.ReftableConfig(Config cfg)
Create a configuration honoring settings in aConfig
.ReftableConfig(Repository db)
Create a configuration honoring the repository's settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fromConfig(Config rc)
Update properties by setting fields from the configuration.int
getLogBlockSize()
Get desired output block size for log entries, in bytes.int
getMaxIndexLevels()
Get maximum depth of the index; 0 for unlimited.int
getRefBlockSize()
Get desired output block size for references, in bytes.int
getRestartInterval()
Get number of references between binary search markers.boolean
isAlignBlocks()
Whether the writer should align blocks.boolean
isIndexObjects()
Whether the writer should index object to ref.void
setAlignBlocks(boolean align)
Whether blocks are written aligned to multiples ofgetRefBlockSize()
.void
setIndexObjects(boolean index)
Whether the reftable may include additional storage to efficiently map fromObjectId
to reference names.void
setLogBlockSize(int szBytes)
Set desired output block size for log entries, in bytes.void
setMaxIndexLevels(int levels)
Set maximum number of levels to use in indexes.void
setRefBlockSize(int szBytes)
Set desired output block size for references, in bytes.void
setRestartInterval(int interval)
Setter for the fieldrestartInterval
.
-
-
-
Constructor Detail
-
ReftableConfig
public ReftableConfig()
Create a default configuration.
-
ReftableConfig
public ReftableConfig(Repository db)
Create a configuration honoring the repository's settings.- Parameters:
db
- the repository to read settings from. The repository is not retained by the new configuration, instead its settings are copied during the constructor.
-
ReftableConfig
public ReftableConfig(Config cfg)
Create a configuration honoring settings in aConfig
.- Parameters:
cfg
- the source to read settings from. The source is not retained by the new configuration, instead its settings are copied during the constructor.
-
ReftableConfig
public ReftableConfig(ReftableConfig cfg)
Copy an existing configuration to a new instance.- Parameters:
cfg
- the source configuration to copy from.
-
-
Method Detail
-
getRefBlockSize
public int getRefBlockSize()
Get desired output block size for references, in bytes.- Returns:
- desired output block size for references, in bytes.
-
setRefBlockSize
public void setRefBlockSize(int szBytes)
Set desired output block size for references, in bytes.- Parameters:
szBytes
- desired output block size for references, in bytes.
-
getLogBlockSize
public int getLogBlockSize()
Get desired output block size for log entries, in bytes.- Returns:
- desired output block size for log entries, in bytes. If 0 the
writer will default to
2 * getRefBlockSize()
.
-
setLogBlockSize
public void setLogBlockSize(int szBytes)
Set desired output block size for log entries, in bytes.- Parameters:
szBytes
- desired output block size for log entries, in bytes. If 0 will default to2 * getRefBlockSize()
.
-
getRestartInterval
public int getRestartInterval()
Get number of references between binary search markers.- Returns:
- number of references between binary search markers.
-
setRestartInterval
public void setRestartInterval(int interval)
Setter for the field
restartInterval
.- Parameters:
interval
- number of references between binary search markers. Ifinterval
is 0 (default), the writer will select a default value based on the block size.
-
getMaxIndexLevels
public int getMaxIndexLevels()
Get maximum depth of the index; 0 for unlimited.- Returns:
- maximum depth of the index; 0 for unlimited.
-
setMaxIndexLevels
public void setMaxIndexLevels(int levels)
Set maximum number of levels to use in indexes.- Parameters:
levels
- maximum number of levels to use in indexes. Lower levels of the index respectgetRefBlockSize()
, and the highest level may exceed that if the number of levels is limited.
-
isAlignBlocks
public boolean isAlignBlocks()
Whether the writer should align blocks.- Returns:
true
if the writer should align blocks.
-
setAlignBlocks
public void setAlignBlocks(boolean align)
Whether blocks are written aligned to multiples ofgetRefBlockSize()
.- Parameters:
align
- iftrue
blocks are written aligned to multiples ofgetRefBlockSize()
. May increase file size due to NUL padding bytes added between blocks. Default istrue
.
-
isIndexObjects
public boolean isIndexObjects()
Whether the writer should index object to ref.- Returns:
true
if the writer should index object to ref.
-
setIndexObjects
public void setIndexObjects(boolean index)
Whether the reftable may include additional storage to efficiently map fromObjectId
to reference names.- Parameters:
index
- iftrue
the reftable may include additional storage to efficiently map fromObjectId
to reference names. By default,true
.
-
fromConfig
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
- configuration to read properties from.
-
-