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.
  • 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

      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 a Config.
      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 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 to 2 * 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. If interval 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 respect getRefBlockSize(), 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 of getRefBlockSize().
      Parameters:
      align - 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.
    • 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 from ObjectId to reference names.
      Parameters:
      index - if true the reftable may include additional storage to efficiently map from ObjectId 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.