db4o 8.0

com.db4o.defragment
Class InMemoryIdMapping

java.lang.Object
  extended by com.db4o.defragment.AbstractIdMapping
      extended by com.db4o.defragment.InMemoryIdMapping
All Implemented Interfaces:
IdMapping

public class InMemoryIdMapping
extends AbstractIdMapping

In-memory mapping for IDs during a defragmentation run. This is faster than the DatabaseIdMapping but it uses more memory. If you have OutOfMemory conditions with this id mapping, use the DatabaseIdMapping instead.

See Also:
Defragment

Constructor Summary
InMemoryIdMapping()
           
 
Method Summary
 int addressForId(int id)
          returns the slot address for an ID
 void close()
          Shuts down the mapping after use.
 void commit()
           
 void mapId(int id, com.db4o.internal.slots.Slot slot)
          Maps an ID to a slot
 int mappedId(int oldID)
          Returns a previously registered mapping ID for the given ID if it exists.
 void open()
          Prepares the mapping for use.
 com.db4o.foundation.Visitable<com.db4o.internal.slots.SlotChange> slotChanges()
          provides a Visitable of all mappings of IDs to slots.
 
Methods inherited from class com.db4o.defragment.AbstractIdMapping
mapId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemoryIdMapping

public InMemoryIdMapping()
Method Detail

mappedId

public int mappedId(int oldID)
Description copied from interface: IdMapping
Returns 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.

open

public void open()
Description copied from interface: IdMapping
Prepares the mapping for use.


close

public void close()
Description copied from interface: IdMapping
Shuts down the mapping after use.


addressForId

public int addressForId(int id)
Description copied from interface: IdMapping
returns the slot address for an ID


mapId

public void mapId(int id,
                  com.db4o.internal.slots.Slot slot)
Description copied from interface: IdMapping
Maps an ID to a slot


slotChanges

public com.db4o.foundation.Visitable<com.db4o.internal.slots.SlotChange> slotChanges()
Description copied from interface: IdMapping
provides a Visitable of all mappings of IDs to slots.


commit

public void commit()

db4o 8.0

Copyright 2009 Versant Corporation. All rights reserved.