Package com.db4o.defragment
Class DefragmentServicesImpl
- java.lang.Object
-
- com.db4o.defragment.DefragmentServicesImpl
-
- All Implemented Interfaces:
DefragmentServices
,IDMapping
public class DefragmentServicesImpl extends java.lang.Object implements DefragmentServices
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefragmentServicesImpl.DbSelector
-
Field Summary
Fields Modifier and Type Field Description static DefragmentServicesImpl.DbSelector
SOURCEDB
static DefragmentServicesImpl.DbSelector
TARGETDB
-
Constructor Summary
Constructors Constructor Description DefragmentServicesImpl(DefragmentConfig defragConfig, DefragmentListener listener)
-
Method Summary
-
-
-
Field Detail
-
SOURCEDB
public static final DefragmentServicesImpl.DbSelector SOURCEDB
-
TARGETDB
public static final DefragmentServicesImpl.DbSelector TARGETDB
-
-
Constructor Detail
-
DefragmentServicesImpl
public DefragmentServicesImpl(DefragmentConfig defragConfig, DefragmentListener listener) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
mappedID
public int mappedID(int oldID, int defaultID)
-
strictMappedID
public int strictMappedID(int oldID) throws MappingNotFoundException
- Specified by:
strictMappedID
in interfaceIDMapping
- Returns:
- a mapping for the given id. if it does refer to a system handler or the empty reference (0), returns the given id.
- Throws:
MappingNotFoundException
- if the given id does not refer to a system handler or the empty reference (0) and if no mapping is found
-
mappedID
public int mappedID(int id)
- Specified by:
mappedID
in interfaceDefragmentServices
-
mapIDs
public void mapIDs(int oldID, int newID, boolean isClassID)
-
close
public void close()
-
bufferByID
public ByteArrayBuffer bufferByID(DefragmentServicesImpl.DbSelector selector, int id)
-
sourceBufferByAddress
public ByteArrayBuffer sourceBufferByAddress(int address, int length) throws java.io.IOException
- Specified by:
sourceBufferByAddress
in interfaceDefragmentServices
- Throws:
java.io.IOException
-
targetBufferByAddress
public ByteArrayBuffer targetBufferByAddress(int address, int length) throws java.io.IOException
- Specified by:
targetBufferByAddress
in interfaceDefragmentServices
- Throws:
java.io.IOException
-
bufferByAddress
public ByteArrayBuffer bufferByAddress(DefragmentServicesImpl.DbSelector selector, int address, int length)
-
targetStatefulBufferByAddress
public StatefulBuffer targetStatefulBufferByAddress(int address, int length) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
allocateTargetSlot
public Slot allocateTargetSlot(int length)
- Specified by:
allocateTargetSlot
in interfaceDefragmentServices
-
targetWriteBytes
public void targetWriteBytes(DefragmentContextImpl context, int address)
- Specified by:
targetWriteBytes
in interfaceDefragmentServices
-
targetWriteBytes
public void targetWriteBytes(ByteArrayBuffer reader, int address)
- Specified by:
targetWriteBytes
in interfaceDefragmentServices
-
storedClasses
public StoredClass[] storedClasses(DefragmentServicesImpl.DbSelector selector)
-
stringIO
public LatinStringIO stringIO()
-
targetCommit
public void targetCommit()
-
sourceHandler
public TypeHandler4 sourceHandler(int id)
-
sourceClassCollectionID
public int sourceClassCollectionID()
-
classIndexID
public int classIndexID(ClassMetadata classMetadata)
-
traverseAll
public void traverseAll(ClassMetadata classMetadata, Visitor4 command)
-
traverseAllIndexSlots
public void traverseAllIndexSlots(ClassMetadata classMetadata, Visitor4 command)
-
traverseAllIndexSlots
public void traverseAllIndexSlots(BTree btree, Visitor4 command)
- Specified by:
traverseAllIndexSlots
in interfaceDefragmentServices
-
registerBTreeIDs
public void registerBTreeIDs(BTree btree, IDMappingCollector collector)
- Specified by:
registerBTreeIDs
in interfaceDefragmentServices
-
databaseIdentityID
public int databaseIdentityID(DefragmentServicesImpl.DbSelector selector)
-
systemTrans
public Transaction systemTrans()
- Specified by:
systemTrans
in interfaceDefragmentServices
-
copyIdentity
public void copyIdentity()
-
replaceClassMetadataRepository
public void replaceClassMetadataRepository()
-
defragIdToTimestampBtree
public void defragIdToTimestampBtree()
-
sourceBufferByID
public ByteArrayBuffer sourceBufferByID(int sourceID)
- Specified by:
sourceBufferByID
in interfaceDefragmentServices
-
sourceUuidIndex
public BTree sourceUuidIndex()
-
targetUuidIndexID
public void targetUuidIndexID(int id)
-
sourceUuidIndexID
public int sourceUuidIndexID()
-
sourceIdToTimestampIndexID
public int sourceIdToTimestampIndexID()
-
classMetadataForId
public ClassMetadata classMetadataForId(int id)
- Specified by:
classMetadataForId
in interfaceDefragmentServices
-
registerUnindexed
public void registerUnindexed(int id)
- Specified by:
registerUnindexed
in interfaceDefragmentServices
-
unindexedIDs
public IdSource unindexedIDs()
- Specified by:
unindexedIDs
in interfaceDefragmentServices
-
sourceObjectHeader
public ObjectHeader sourceObjectHeader(ByteArrayBuffer buffer)
-
blockSize
public int blockSize()
-
sourceAddressByID
public int sourceAddressByID(int sourceID)
- Specified by:
sourceAddressByID
in interfaceDefragmentServices
-
targetAddressByID
public int targetAddressByID(int sourceID)
- Specified by:
targetAddressByID
in interfaceDefragmentServices
-
accept
public boolean accept(StoredClass klass)
-
targetNewId
public int targetNewId()
- Specified by:
targetNewId
in interfaceDefragmentServices
-
mapping
public IdMapping mapping()
- Specified by:
mapping
in interfaceDefragmentServices
-
commitIds
public void commitIds()
- Specified by:
commitIds
in interfaceDefragmentServices
-
-