Class JsckConfig
Jsck
key/value database consistency inspection.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet theEncodingRegistry
used to interpret encoding names in recorded schemas.int
Configure a database format version to forcibly apply.Configure a destination for log messages emitted during the scan.long
Configure a maximum number of issues to generate.Configure schemas to forcibly apply into the schema table.ConfigureSchemaId
s to forcibly apply into the storage ID table.boolean
Determine whether to garbage collect unused schema versions.boolean
isRepair()
Determine whether to repair any database inconsistencies found.void
setEncodingRegistry
(EncodingRegistry encodingRegistry) void
setFormatVersionOverride
(int formatVersionOverride) void
setGarbageCollectSchemas
(boolean garbageCollectSchemas) void
setJsckLogger
(JsckLogger logger) void
setMaxIssues
(long maxIssues) void
setRepair
(boolean repair) void
setSchemaOverrides
(Map<Integer, SchemaModel> schemaOverrides) void
setStorageIdOverrides
(Map<Integer, SchemaId> storageIdOverrides)
-
Constructor Details
-
JsckConfig
public JsckConfig()
-
-
Method Details
-
getEncodingRegistry
Get theEncodingRegistry
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
-
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
Configure a destination for log messages emitted during the scan.By default, messages are logged via this class'
Logger
viaJsckLogger.wrap()
.- Returns:
- true to repair inconsistencies, otherwise false
-
setJsckLogger
-
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
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
-
getStorageIdOverrides
ConfigureSchemaId
s 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
-
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)
-