Package com.db4o.defragment
Class DatabaseIdMapping
- java.lang.Object
- 
- com.db4o.defragment.AbstractIdMapping
- 
- com.db4o.defragment.DatabaseIdMapping
 
 
- 
- All Implemented Interfaces:
- IdMapping
 
 public class DatabaseIdMapping extends AbstractIdMapping Database based mapping for IDs during a defragmentation run. Use this mapping to keep memory consumption lower than when using theInMemoryIdMapping.- See Also:
- Defragment
 
- 
- 
Constructor SummaryConstructors Constructor Description DatabaseIdMapping(java.lang.String fileName)Will maintain the ID mapping as a BTree in the file with the given path.DatabaseIdMapping(java.lang.String fileName, int nodeSize, int commitFrequency)Will maintain the ID mapping as a BTree in the file with the given path.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddressForId(int id)returns the slot address for an IDvoidclose()Shuts down the mapping after use.voidcommit()voidmapId(int id, Slot slot)Maps an ID to a slotprotected voidmapNonClassIDs(int origID, int mappedID)intmappedId(int oldID)Returns a previously registered mapping ID for the given ID if it exists.voidopen()Prepares the mapping for use.Visitable<SlotChange>slotChanges()provides a Visitable of all mappings of IDs to slots.- 
Methods inherited from class com.db4o.defragment.AbstractIdMappingmapId, mappedClassID
 
- 
 
- 
- 
- 
Constructor Detail- 
DatabaseIdMappingpublic DatabaseIdMapping(java.lang.String fileName) Will maintain the ID mapping as a BTree in the file with the given path. If a file exists in this location, it will be DELETED. Node size and cache height of the tree will be the default values used by the BTree implementation. The tree will never commit.- Parameters:
- fileName- The location where the BTree file should be created.
 
 - 
DatabaseIdMappingpublic DatabaseIdMapping(java.lang.String fileName, int nodeSize, int commitFrequency)Will maintain the ID mapping as a BTree in the file with the given path. If a file exists in this location, it will be DELETED.- Parameters:
- fileName- The location where the BTree file should be created.
- nodeSize- The size of a BTree node
- commitFrequency- The number of inserts after which a commit should be issued (<=0: never commit)
 
 
- 
 - 
Method Detail- 
mappedIdpublic int mappedId(int oldID) Description copied from interface:IdMappingReturns a previously registered mapping ID for the given ID if it exists.- Returns:
- The mapping ID for the given original ID or 0, if none has been registered.
 
 - 
mapNonClassIDsprotected void mapNonClassIDs(int origID, int mappedID)- Specified by:
- mapNonClassIDsin class- AbstractIdMapping
 
 - 
openpublic void open() throws java.io.IOExceptionDescription copied from interface:IdMappingPrepares the mapping for use.- Throws:
- java.io.IOException
 
 - 
closepublic void close() Description copied from interface:IdMappingShuts down the mapping after use.
 - 
mapIdpublic void mapId(int id, Slot slot)Description copied from interface:IdMappingMaps an ID to a slot
 - 
slotChangespublic Visitable<SlotChange> slotChanges() Description copied from interface:IdMappingprovides a Visitable of all mappings of IDs to slots.
 - 
addressForIdpublic int addressForId(int id) Description copied from interface:IdMappingreturns the slot address for an ID
 - 
commitpublic void commit() 
 
- 
 
-