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 booleanprivate booleanprivate intprivate intprivate intprivate 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 TypeMethodDescriptionvoidfromConfig(Config rc) Update properties by setting fields from the configuration.intGet desired output block size for log entries, in bytes.intGet maximum depth of the index; 0 for unlimited.intGet desired output block size for references, in bytes.intGet number of references between binary search markers.booleanWhether the writer should align blocks.booleanWhether the writer should index object to ref.voidsetAlignBlocks(boolean align) Whether blocks are written aligned to multiples ofgetRefBlockSize().voidsetIndexObjects(boolean index) Whether the reftable may include additional storage to efficiently map fromObjectIdto reference names.voidsetLogBlockSize(int szBytes) Set desired output block size for log entries, in bytes.voidsetMaxIndexLevels(int levels) Set maximum number of levels to use in indexes.voidsetRefBlockSize(int szBytes) Set desired output block size for references, in bytes.voidsetRestartInterval(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. Ifintervalis 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:
trueif the writer should align blocks.
-
setAlignBlocks
public void setAlignBlocks(boolean align) Whether blocks are written aligned to multiples ofgetRefBlockSize().- Parameters:
align- iftrueblocks 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:
trueif the writer should index object to ref.
-
setIndexObjects
public void setIndexObjects(boolean index) Whether the reftable may include additional storage to efficiently map fromObjectIdto reference names.- Parameters:
index- iftruethe reftable may include additional storage to efficiently map fromObjectIdto 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.
-