Class JsckConfig

java.lang.Object
io.permazen.jsck.JsckConfig

public class JsckConfig extends Object
Configuration for a Jsck key/value database consistency inspection.
  • Constructor Details

    • JsckConfig

      public JsckConfig()
  • Method Details

    • getEncodingRegistry

      public EncodingRegistry getEncodingRegistry()
      Get the EncodingRegistry used to interpret encoding names in recorded schemas.

      Any custom encodings used to encode fields in the database must be included in a configured EncodingRegistry.

      Default is new EncodingRegistry().

      Returns:
      registry of encodings
    • setEncodingRegistry

      public void setEncodingRegistry(EncodingRegistry encodingRegistry)
    • isGarbageCollectSchemas

      public boolean isGarbageCollectSchemas()
      Determine whether to garbage collect unused schema versions.

      If set, at the end of inspection any unused schema versions will be deleted. Note this occurs even if isRepair() returns false.

      Default false.

      Returns:
      true to garbage collect unused schema versions, otherwise false
    • setGarbageCollectSchemas

      public void setGarbageCollectSchemas(boolean garbageCollectSchemas)
    • getJsckLogger

      public JsckLogger getJsckLogger()
      Configure a destination for log messages emitted during the scan.

      By default, messages are logged via this class' Logger via JsckLogger.wrap().

      Returns:
      true to repair inconsistencies, otherwise false
    • setJsckLogger

      public void setJsckLogger(JsckLogger logger)
    • isRepair

      public boolean isRepair()
      Determine whether to repair any database inconsistencies found.

      Without this flag being set, no changes will be made to the key/value store, with the exception of garbage collecting schema versions.

      Default false.

      Returns:
      true to repair inconsistencies, otherwise false
    • setRepair

      public void setRepair(boolean repair)
    • getSchemaOverrides

      public Map<Integer,SchemaModel> getSchemaOverrides()
      Configure schemas to forcibly apply into the schema table.

      Entries in the configured Map will be forcibly written to the database, causing any existing schemas recorded under the same schema index to be overridden.

      Entries with null values will forcibly delete the corresponding schemas and all objects having that schema version from the database.

      Warning: Use of this property is dangerous and for experts only.

      Default is an empty map (i.e., disabled).

      Returns:
      map from schema index to schema model (to add/override schemas) or null (to remove schemas)
    • setSchemaOverrides

      public void setSchemaOverrides(Map<Integer,SchemaModel> schemaOverrides)
    • getStorageIdOverrides

      public Map<Integer,SchemaId> getStorageIdOverrides()
      Configure SchemaIds to forcibly apply into the storage ID table.

      Entries in the configured Map will be forcibly written to the database, causing any existing schema ID's recorded under the same storage ID to be overridden.

      Entries with null values will forcibly delete the corresponding storage ID table entry from the database.

      Warning: Use of this property is dangerous and for experts only.

      Default is an empty map (i.e., disabled).

      Returns:
      map from storage ID to schema ID (to add/override schema IDs) or null (to remove schema IDs)
    • setStorageIdOverrides

      public void setStorageIdOverrides(Map<Integer,SchemaId> storageIdOverrides)
    • getFormatVersionOverride

      public int getFormatVersionOverride()
      Configure a database format version to forcibly apply.

      Using this property will cause any existing database format version number to be overridden with the configured value.

      Warning: Use of this property is dangerous and for experts only.

      Default zero (i.e., disabled).

      Returns:
      enforced format version, or zero if disabled
    • setFormatVersionOverride

      public void setFormatVersionOverride(int formatVersionOverride)
    • getMaxIssues

      public long getMaxIssues()
      Configure a maximum number of issues to generate.

      Default is Long.MAX_VALUE.

      Returns:
      maximum number of issues
    • setMaxIssues

      public void setMaxIssues(long maxIssues)