Package com.db4o.defragment
Class DefragmentConfig
- java.lang.Object
- 
- com.db4o.defragment.DefragmentConfig
 
- 
 public class DefragmentConfig extends java.lang.ObjectConfiguration for a defragmentation run.- See Also:
- Defragment
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classDefragmentConfig.NullFilter
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringBACKUP_SUFFIXstatic booleanDEBUG
 - 
Constructor SummaryConstructors Constructor Description DefragmentConfig(java.lang.String origPath)Creates a configuration for a defragmentation run.DefragmentConfig(java.lang.String origPath, java.lang.String backupPath)Creates a configuration for a defragmentation run with in-memory mapping.DefragmentConfig(java.lang.String origPath, java.lang.String backupPath, IdMapping mapping)Creates a configuration for a defragmentation run.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringbackupPath()StoragebackupStorage()voidbackupStorage(Storage backupStorage)intblockSize()ConfigurationclonedDb4oConfig()Configurationdb4oConfig()voiddb4oConfig(Configuration config)Deprecated.since 7.9: usedb4oConfig(EmbeddedConfiguration)insteadvoiddb4oConfig(EmbeddedConfiguration config)booleanfileNeedsUpgrade()booleanforceBackupDelete()voidforceBackupDelete(boolean forceBackupDelete)IdMappingmapping()intobjectCommitFrequency()voidobjectCommitFrequency(int objectCommitFrequency)java.lang.StringorigPath()booleanreadOnly()voidreadOnly(boolean flag)allows turning on and off readonly mode.
 When changed classes are likely to be detected defragment, it may be required to open the original database in read/write mode.StoredClassFilterstoredClassFilter()voidstoredClassFilter(StoredClassFilter storedClassFilter)java.lang.StringtempPath()voidupgradeFile(java.lang.String tempPath)Instruct the defragment process to upgrade the source file to the current db4o version prior to defragmenting it.static ConfigurationvanillaDb4oConfig(int blockSize)
 
- 
- 
- 
Field Detail- 
DEBUGpublic static final boolean DEBUG - See Also:
- Constant Field Values
 
 - 
BACKUP_SUFFIXpublic static final java.lang.String BACKUP_SUFFIX - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
DefragmentConfigpublic DefragmentConfig(java.lang.String origPath) Creates a configuration for a defragmentation run. The backup and mapping file paths are generated from the original path by appending the default suffixes. All properties other than the provided paths are set to FALSE by default.- Parameters:
- origPath- The path to the file to be defragmented. Must exist and must be a valid db4o file.
 
 - 
DefragmentConfigpublic DefragmentConfig(java.lang.String origPath, java.lang.String backupPath)Creates a configuration for a defragmentation run with in-memory mapping. All properties other than the provided paths are set to FALSE by default.- Parameters:
- origPath- The path to the file to be defragmented. Must exist and must be a valid db4o file.
- backupPath- The path to the backup of the original file. No file should exist at this position, otherwise it will be OVERWRITTEN if forceBackupDelete() is set to true!
 
 - 
DefragmentConfigpublic DefragmentConfig(java.lang.String origPath, java.lang.String backupPath, IdMapping mapping)Creates a configuration for a defragmentation run. All properties other than the provided paths are set to FALSE by default.- Parameters:
- origPath- The path to the file to be defragmented. Must exist and must be a valid db4o file.
- backupPath- The path to the backup of the original file. No file should exist at this position, otherwise it will be OVERWRITTEN if forceBackupDelete() is set to true!
- mapping- The Id mapping to be used internally. Pass either a- InMemoryIdMappingfor fastest defragment or a- DatabaseIdMappingfor low memory consumption.
 
 
- 
 - 
Method Detail- 
origPathpublic java.lang.String origPath() - Returns:
- The path to the file to be defragmented.
 
 - 
backupPathpublic java.lang.String backupPath() - Returns:
- The path to the backup of the original file.
 
 - 
mappingpublic IdMapping mapping() - Returns:
- The temporary ID mapping used internally. For internal use only.
 
 - 
storedClassFilterpublic StoredClassFilter storedClassFilter() - Returns:
- The StoredClassFilterused to select stored class extents to be included into the defragmented file.
 
 - 
storedClassFilterpublic void storedClassFilter(StoredClassFilter storedClassFilter) - Parameters:
- storedClassFilter- The- StoredClassFilterused to select stored class extents to be included into the defragmented file.
 
 - 
forceBackupDeletepublic boolean forceBackupDelete() - Returns:
- true, if an existing backup file should be deleted, false otherwise.
 
 - 
forceBackupDeletepublic void forceBackupDelete(boolean forceBackupDelete) - Parameters:
- forceBackupDelete- true, if an existing backup file should be deleted, false otherwise.
 
 - 
readOnlypublic void readOnly(boolean flag) allows turning on and off readonly mode.
 When changed classes are likely to be detected defragment, it may be required to open the original database in read/write mode.
 Readonly mode is the default setting.- Parameters:
- flag- false, to turn off readonly mode.
 
 - 
readOnlypublic boolean readOnly() - Returns:
- true, if the original database file is to be opened in readonly mode.
 
 - 
db4oConfigpublic Configuration db4oConfig() - Returns:
- The db4o Configurationto be applied during the defragment process.
 
 - 
db4oConfigpublic void db4oConfig(Configuration config) Deprecated.since 7.9: usedb4oConfig(EmbeddedConfiguration)instead- Parameters:
- config- The db4o- Configurationto be applied during the defragment process.
 
 - 
db4oConfigpublic void db4oConfig(EmbeddedConfiguration config) - Parameters:
- config- The db4o- EmbeddedConfigurationto be applied during the defragment process.
- Since:
- 7.9
 
 - 
objectCommitFrequencypublic int objectCommitFrequency() 
 - 
objectCommitFrequencypublic void objectCommitFrequency(int objectCommitFrequency) - Parameters:
- objectCommitFrequency- The number of processed object (slots) that should trigger an intermediate commit of the target file. Default: 0, meaning: never.
 
 - 
upgradeFilepublic void upgradeFile(java.lang.String tempPath) Instruct the defragment process to upgrade the source file to the current db4o version prior to defragmenting it. Use this option if your source file has been created with an older db4o version than the one you are using.- Parameters:
- tempPath- The location for an intermediate, upgraded version of the source file.
 
 - 
fileNeedsUpgradepublic boolean fileNeedsUpgrade() 
 - 
tempPathpublic java.lang.String tempPath() 
 - 
blockSizepublic int blockSize() 
 - 
vanillaDb4oConfigpublic static Configuration vanillaDb4oConfig(int blockSize) 
 - 
clonedDb4oConfigpublic Configuration clonedDb4oConfig() 
 - 
backupStoragepublic void backupStorage(Storage backupStorage) 
 - 
backupStoragepublic Storage backupStorage() 
 
- 
 
-