private long IdSystemUsage()
        {
            IIdSystem idSystem = _db.IdSystem();
            long      usage    = 0;

            while (idSystem is BTreeIdSystem)
            {
                IIdSystem parentIdSystem = ((IIdSystem)FieldValue(idSystem, "_parentIdSystem"));
                usage += BTreeUsage(_db.SystemTransaction(), parentIdSystem, (BTree)FieldValue(idSystem
                                                                                               , "_bTree"), _slots);
                PersistentIntegerArray persistentState = (PersistentIntegerArray)FieldValue(idSystem
                                                                                            , "_persistentState");
                int persistentStateId = persistentState.GetID();
                Db4objects.Db4o.Internal.Slots.Slot persistentStateSlot = parentIdSystem.CommittedSlot
                                                                              (persistentStateId);
                _slots.Add(persistentStateSlot);
                usage   += persistentStateSlot.Length();
                idSystem = parentIdSystem;
            }
            if (idSystem is InMemoryIdSystem)
            {
                Db4objects.Db4o.Internal.Slots.Slot idSystemSlot = ((Db4objects.Db4o.Internal.Slots.Slot
                                                                     )FieldValue(idSystem, "_slot"));
                usage += idSystemSlot.Length();
                _slots.Add(idSystemSlot);
            }
            return(usage);
        }
Esempio n. 2
0
        private long IdSystemUsage()
        {
            IntByRef usage = new IntByRef();

            _db.IdSystem().TraverseOwnSlots(new _IProcedure4_217(this, usage));
            return(usage.value);
        }
Esempio n. 3
0
 public override void CompleteInterruptedTransaction(LocalObjectContainer container
     )
 {
     var systemData = container.SystemData();
     container.IdSystem().CompleteInterruptedTransaction(systemData.TransactionPointer1
         (), systemData.TransactionPointer2());
 }
            public void Apply(object state)
            {
                ConsistencyCheckerTestCase.Item item = ((ConsistencyCheckerTestCase.Item)((Pair)state
                                                                                          ).second);
                LocalObjectContainer db = ((LocalObjectContainer)((Pair)state).first);
                int  id   = (int)db.GetID(item);
                Slot slot = db.IdSystem().CommittedSlot(id);

                db.FreespaceManager().Free(new Slot(slot.Address() + 1, slot.Length()));
            }
Esempio n. 5
0
        private IList CheckClassIndices()
        {
            IList     invalidIds = new ArrayList();
            IIdSystem idSystem   = _db.IdSystem();

            if (!(idSystem is BTreeIdSystem))
            {
                return(invalidIds);
            }
            ClassMetadataIterator clazzIter = _db.ClassCollection().Iterator();

            while (clazzIter.MoveNext())
            {
                ClassMetadata clazz = clazzIter.CurrentClass();
                if (!clazz.HasClassIndex())
                {
                    continue;
                }
                BTreeClassIndexStrategy index = (BTreeClassIndexStrategy)clazz.Index();
                index.TraverseIds(_db.SystemTransaction(), new _IVisitor4_64(this, invalidIds, clazz
                                                                             ));
            }
            return(invalidIds);
        }
Esempio n. 6
0
 internal static long BTreeUsage(LocalObjectContainer db, BTree btree, ISlotMap slotMap
                                 )
 {
     return(BTreeUsage(db.SystemTransaction(), db.IdSystem(), btree, slotMap));
 }
Esempio n. 7
0
 public virtual int TargetNewId()
 {
     return(_targetDb.IdSystem().NewId());
 }