Package com.db4o.defragment
Interface IdMapping
-
- All Known Implementing Classes:
AbstractIdMapping,DatabaseIdMapping,InMemoryIdMapping
public interface IdMappingThe ID mapping used internally during a defragmentation run.- See Also:
Defragment
-
-
Method Summary
All Methods Instance Methods Abstract 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 origId, int mappedId, boolean isClassId)Registers a mapping for the given IDs.voidmapId(int id, Slot slot)Maps an ID to a slotintmappedId(int origId)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.
-
-
-
Method Detail
-
mappedId
int mappedId(int origId)
Returns a previously registered mapping ID for the given ID if it exists.- Parameters:
origID- The original ID- Returns:
- The mapping ID for the given original ID or 0, if none has been registered.
-
mapId
void mapId(int origId, int mappedId, boolean isClassId)Registers a mapping for the given IDs.- Parameters:
origID- The original IDmappedID- The ID to be mapped to the original ID.isClassID- true if the given original ID specifies a class slot, false otherwise.
-
mapId
void mapId(int id, Slot slot)Maps an ID to a slot- Parameters:
id-slot-
-
slotChanges
Visitable<SlotChange> slotChanges()
provides a Visitable of all mappings of IDs to slots.
-
open
void open() throws java.io.IOException
Prepares the mapping for use.- Throws:
java.io.IOException
-
close
void close()
Shuts down the mapping after use.
-
addressForId
int addressForId(int id)
returns the slot address for an ID
-
commit
void commit()
-
-