Constructor and Description |
---|
JsckConfig() |
Modifier and Type | Method and Description |
---|---|
FieldTypeRegistry |
getFieldTypeRegistry()
Get the
FieldTypeRegistry used to interpret field type names in recorded schemas. |
int |
getForceFormatVersion()
Configure a database format version to forcibly apply.
|
Map<Integer,SchemaModel> |
getForceSchemaVersions()
Configure schema versions to forcibly apply.
|
JsckLogger |
getJsckLogger()
Configure a destination for log messages emitted during the scan.
|
KeyRanges |
getKeysToInspect()
Get the restricted ranges of keys that should be inspected, if any.
|
long |
getMaxIssues()
Configure a maximum number of issues to generate.
|
boolean |
isGarbageCollectSchemas()
Determine whether to garbage collect unused schema versions.
|
boolean |
isRepair()
Determine whether to repair any database inconsistencies found.
|
void |
setFieldTypeRegistry(FieldTypeRegistry fieldTypeRegistry) |
void |
setForceFormatVersion(int forceFormatVersion) |
void |
setForceSchemaVersions(Map<Integer,SchemaModel> forceSchemaVersions) |
void |
setGarbageCollectSchemas(boolean garbageCollectSchemas) |
void |
setJsckLogger(JsckLogger logger) |
void |
setKeysToInspect(KeyRanges keysToInspect) |
void |
setMaxIssues(long maxIssues) |
void |
setRepair(boolean repair) |
public KeyRanges getKeysToInspect()
This property allows limiting inspection to specific objects, object types, or indexes. Note: recorded schema information is always fully checked.
Default is null, i.e., no restriction.
TODO: this is not implemented yet
public void setKeysToInspect(KeyRanges keysToInspect)
public FieldTypeRegistry getFieldTypeRegistry()
FieldTypeRegistry
used to interpret field type names in recorded schemas.
Any custom field types used to encode fields in the database must be included in a configured FieldTypeRegistry
.
Default is new FieldTypeRegistry()
.
public void setFieldTypeRegistry(FieldTypeRegistry fieldTypeRegistry)
public boolean isGarbageCollectSchemas()
If set, at the end of inspection any unused schema versions will be deleted.
Note this occurs even if isRepair()
returns false.
Default false.
public void setGarbageCollectSchemas(boolean garbageCollectSchemas)
public JsckLogger getJsckLogger()
By default, messages are logged via this class' Logger
via JsckLogger.wrap()
.
public void setJsckLogger(JsckLogger logger)
public boolean isRepair()
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.
public void setRepair(boolean repair)
public Map<Integer,SchemaModel> getForceSchemaVersions()
Entries in the configured Map
will be forcibly written to the database, causing any existing schema versions
recorded under the same version number to be overridden. Otherwise, if a valid recorded schema does not have a
corresponding entry in this map, it is assumed by Jsck
to be accurate.
Entries with null values will forcibly delete the corresponding schema version and all objects having that schema version from the database.
Warning: use of this property is dangerous, because it affects how Jsck
interprets the key/value
data of objects with the corresponding version(s) in the database. This property should only be used if:
Default is an empty map (i.e., disabled).
public void setForceSchemaVersions(Map<Integer,SchemaModel> forceSchemaVersions)
public int getForceFormatVersion()
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, because it affects how Jsck
interprets all other key/value
data in the database. This property should only be used if:
Jsck
utility is at least as current as the any version of Permazen that has written to the databaseIn other words, "only use this if you know what you are doing".
Default zero (i.e., disabled).
public void setForceFormatVersion(int forceFormatVersion)
public long getMaxIssues()
Default is Long.MAX_VALUE
.
public void setMaxIssues(long maxIssues)
Copyright © 2022. All rights reserved.