Exemplo n.º 1
0
 public void mapId(int id, Slot slot) {
   _slotTree.add(trans(), new IdSlotMapping(id, slot.address(), slot.length()));
   if (_commitFrequency > 0) {
     _slotInsertCount++;
     if (_commitFrequency == _slotInsertCount) {
       _slotTree.commit(trans());
       _slotInsertCount = 0;
     }
   }
 }
Exemplo n.º 2
0
 protected void mapNonClassIDs(int origID, int mappedID) {
   _cache = new MappedIDPair(origID, mappedID);
   _idTree.add(trans(), _cache);
   if (_commitFrequency > 0) {
     _idInsertCount++;
     if (_commitFrequency == _idInsertCount) {
       _idTree.commit(trans());
       _idInsertCount = 0;
     }
   }
 }
Exemplo n.º 3
0
 public int addressForId(int id) {
   BTreeRange range = _slotTree.searchRange(trans(), new IdSlotMapping(id, 0, 0));
   Iterator4 pointers = range.pointers();
   if (pointers.moveNext()) {
     BTreePointer pointer = (BTreePointer) pointers.current();
     return ((IdSlotMapping) pointer.key())._address;
   }
   return 0;
 }
Exemplo n.º 4
0
 public int mappedId(int oldID) {
   if (_cache.orig() == oldID) {
     return _cache.mapped();
   }
   int classID = mappedClassID(oldID);
   if (classID != 0) {
     return classID;
   }
   BTreeRange range = _idTree.searchRange(trans(), new MappedIDPair(oldID, 0));
   Iterator4 pointers = range.pointers();
   if (pointers.moveNext()) {
     BTreePointer pointer = (BTreePointer) pointers.current();
     _cache = (MappedIDPair) pointer.key();
     return _cache.mapped();
   }
   return 0;
 }
 public void processBTree(final DefragmentServicesImpl context, BTree btree)
     throws CorruptionException, IOException {
   btree.defragBTree(context);
 }