1 21 package com.db4o.defragment; 22 23 import com.db4o.*; 24 import com.db4o.inside.btree.*; 25 26 34 final class SecondPassCommand implements PassCommand { 35 36 public void processClass(DefragContextImpl context, final YapClass yapClass, int id,final int classIndexID) throws CorruptionException { 37 if(context.mappedID(id,-1)==-1) { 38 System.err.println("MAPPING NOT FOUND: "+id); 39 } 40 ReaderPair.processCopy(context, id, new SlotCopyHandler() { 41 public void processCopy(ReaderPair readers) throws CorruptionException { 42 yapClass.defragClass(readers, classIndexID); 43 } 44 }); 45 } 46 47 public void processObjectSlot(DefragContextImpl context, final YapClass yapClass, int id, boolean registerAddresses) throws CorruptionException { 48 ReaderPair.processCopy(context, id, new SlotCopyHandler() { 49 public void processCopy(ReaderPair readers) { 50 YapClass.defragObject(readers); 51 } 52 },registerAddresses); 53 } 54 55 public void processClassCollection(DefragContextImpl context) throws CorruptionException { 56 ReaderPair.processCopy(context, context.sourceClassCollectionID(), new SlotCopyHandler() { 57 public void processCopy(ReaderPair readers) { 58 YapClassCollection.defrag(readers); 59 } 60 }); 61 } 62 63 public void processBTree(final DefragContextImpl context, BTree btree) throws CorruptionException { 64 btree.defragBTree(context); 65 } 66 67 public void flush(DefragContextImpl context) { 68 } 69 } | Popular Tags |