Class ReftableConfig
java.lang.Object
org.eclipse.jgit.internal.storage.reftable.ReftableConfig
Configuration used by a reftable writer when constructing the stream.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private boolean
private int
private int
private int
private int
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a default configuration.Copy an existing configuration to a new instance.ReftableConfig
(Config cfg) Create a configuration honoring settings in aConfig
.Create a configuration honoring the repository's settings. -
Method Summary
Modifier and TypeMethodDescriptionvoid
fromConfig
(Config rc) Update properties by setting fields from the configuration.int
Get desired output block size for log entries, in bytes.int
Get maximum depth of the index; 0 for unlimited.int
Get desired output block size for references, in bytes.int
Get number of references between binary search markers.boolean
Whether the writer should align blocks.boolean
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
.
-
Field Details
-
refBlockSize
private int refBlockSize -
logBlockSize
private int logBlockSize -
restartInterval
private int restartInterval -
maxIndexLevels
private int maxIndexLevels -
alignBlocks
private boolean alignBlocks -
indexObjects
private boolean indexObjects
-
-
Constructor Details
-
ReftableConfig
public ReftableConfig()Create a default configuration. -
ReftableConfig
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
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
Copy an existing configuration to a new instance.- Parameters:
cfg
- the source configuration to copy from.
-
-
Method Details
-
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
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.
-