Class VerifyConfig
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VerifyConfigDefault configuration used if null is passed toDatabase.verify. -
Constructor Summary
ConstructorsConstructorDescriptionAn instance created using the default constructor is initialized with the system's default settings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn true if theDatabase.verifyis configured to output all the key/data pairs in the file that can be found.booleanReturn true if theDatabase.verifyis configured to skip the database checks for btree and duplicate sort order and for hashing.booleanReturn true if theDatabase.verifyis configured to do database checks for btree and duplicate sort order and for hashing, skipped by verification operations configured byVerifyConfig.setNoOrderCheck.booleanReturn true if theDatabase.verifyis configured to use printing characters to where possible.booleanReturn true if theDatabase.verifyis configured to write the key/data pairs from all databases in the file to the file stream named by the outfile parameter..voidsetAggressive(boolean aggressive) ConfigureDatabase.verifyto output all the key/data pairs in the file that can be found.voidsetNoOrderCheck(boolean noOrderCheck) ConfigureDatabase.verifyto skip the database checks for btree and duplicate sort order and for hashing.voidsetOrderCheckOnly(boolean orderCheckOnly) ConfigureDatabase.verifyto do database checks for btree and duplicate sort order and for hashing, skipped by verification operations configured byVerifyConfig.setNoOrderCheck.voidsetPrintable(boolean printable) ConfigureDatabase.verifyto use printing characters to where possible.voidsetSalvage(boolean salvage) ConfigureDatabase.verifyto write the key/data pairs from all databases in the file to the file stream named by the outfile parameter.
-
Field Details
-
DEFAULT
Default configuration used if null is passed toDatabase.verify.
-
-
Constructor Details
-
VerifyConfig
public VerifyConfig()An instance created using the default constructor is initialized with the system's default settings.
-
-
Method Details
-
setAggressive
public void setAggressive(boolean aggressive) ConfigureDatabase.verifyto output all the key/data pairs in the file that can be found.By default,
Database.verifydoes not assume corruption. For example, if a key/data pair on a page is marked as deleted, it is not then written to the output file. WhenDatabase.verifyis configured with this method, corruption is assumed, and any key/data pair that can be found is written. In this case, key/data pairs that are corrupted or have been deleted may appear in the output (even if the file being salvaged is in no way corrupt), and the output will almost certainly require editing before being loaded into a database.- Parameters:
aggressive- If true, configureDatabase.verifyto output all the key/data pairs in the file that can be found.
-
getAggressive
public boolean getAggressive()Return true if theDatabase.verifyis configured to output all the key/data pairs in the file that can be found.This method may be called at any time during the life of the application.
- Returns:
- True if the
Database.verifyis configured to output all the key/data pairs in the file that can be found.
-
setNoOrderCheck
public void setNoOrderCheck(boolean noOrderCheck) ConfigureDatabase.verifyto skip the database checks for btree and duplicate sort order and for hashing.Database.verifynormally verifies that btree keys and duplicate items are correctly sorted, and hash keys are correctly hashed. If the file being verified contains multiple databases using differing sorting or hashing algorithms, some of them must necessarily fail database verification because only one sort order or hash function can be specified beforeDatabase.verifyis called. To verify files with multiple databases having differing sorting orders or hashing functions, first perform verification of the file as a whole usingDatabase.verifyconfigured withVerifyConfig.setNoOrderCheck, and then individually verify the sort order and hashing function for each database in the file using 4_link(Database, verify) configured withVerifyConfig.setOrderCheckOnly.- Parameters:
noOrderCheck- If true, configureDatabase.verifyto skip the database checks for btree and duplicate sort order and for hashing.
-
getNoOrderCheck
public boolean getNoOrderCheck()Return true if theDatabase.verifyis configured to skip the database checks for btree and duplicate sort order and for hashing.This method may be called at any time during the life of the application.
- Returns:
- True if the
Database.verifyis configured to skip the database checks for btree and duplicate sort order and for hashing.
-
setOrderCheckOnly
public void setOrderCheckOnly(boolean orderCheckOnly) ConfigureDatabase.verifyto do database checks for btree and duplicate sort order and for hashing, skipped by verification operations configured byVerifyConfig.setNoOrderCheck.When this flag is specified, a database name must be specified to
Database.verify, indicating the database in the physical file which is to be checked.This configuration is only safe to use on databases that have already successfully been verified with
VerifyConfig.setNoOrderCheckconfigured.- Parameters:
orderCheckOnly- If true, configureDatabase.verifyto do database checks for btree and duplicate sort order and for hashing, skipped by verification operations configured byVerifyConfig.setNoOrderCheck.
-
getOrderCheckOnly
public boolean getOrderCheckOnly()Return true if theDatabase.verifyis configured to do database checks for btree and duplicate sort order and for hashing, skipped by verification operations configured byVerifyConfig.setNoOrderCheck.This method may be called at any time during the life of the application.
- Returns:
- True if the
Database.verifyis configured to do database checks for btree and duplicate sort order and for hashing, skipped by verification operations configured byVerifyConfig.setNoOrderCheck.
-
setPrintable
public void setPrintable(boolean printable) ConfigureDatabase.verifyto use printing characters to where possible.This method is only meaningful when combined with
VerifyConfig.setSalvage.This configuration permits users to use standard text editors and tools to modify the contents of databases or selectively remove data from salvager output.
Note: different systems may have different notions about what characters are considered printing characters, and databases dumped in this manner may be less portable to external systems.
- Parameters:
printable- If true, configureDatabase.verifyto use printing characters to where possible.
-
getPrintable
public boolean getPrintable()Return true if theDatabase.verifyis configured to use printing characters to where possible.This method may be called at any time during the life of the application.
- Returns:
- True if the
Database.verifyis configured to use printing characters to where possible.
-
setSalvage
public void setSalvage(boolean salvage) ConfigureDatabase.verifyto write the key/data pairs from all databases in the file to the file stream named by the outfile parameter.The output format is the same as that specified for the db_dump utility, and can be used as input for the db_load utility.
Because the key/data pairs are output in page order as opposed to the sort order used by db_dump, using
Database.verifyto dump key/data pairs normally produces less than optimal loads for Btree databases.- Parameters:
salvage- If true, configureDatabase.verifyto write the key/data pairs from all databases in the file to the file stream named by the outfile parameter.
-
getSalvage
public boolean getSalvage()Return true if theDatabase.verifyis configured to write the key/data pairs from all databases in the file to the file stream named by the outfile parameter..This method may be called at any time during the life of the application.
- Returns:
- True if the
Database.verifyis configured to write the key/data pairs from all databases in the file to the file stream named by the outfile parameter..
-