コード例 #1
0
        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);
        }
コード例 #2
0
        private static long BTreeUsage(Transaction transaction, IIdSystem idSystem, BTree
                                       btree, ISlotMap slotMap)
        {
            IEnumerator nodeIter = btree.AllNodeIds(transaction);

            Db4objects.Db4o.Internal.Slots.Slot btreeSlot = idSystem.CommittedSlot(btree.GetID
                                                                                       ());
            slotMap.Add(btreeSlot);
            long usage = btreeSlot.Length();

            while (nodeIter.MoveNext())
            {
                int curNodeId = ((int)nodeIter.Current);
                Db4objects.Db4o.Internal.Slots.Slot slot = idSystem.CommittedSlot(curNodeId);
                slotMap.Add(slot);
                usage += slot.Length();
            }
            return(usage);
        }
コード例 #3
0
        private static long BTreeUsage(Transaction transaction, IIdSystem idSystem, BTree
                                       btree, ISlotMap slotMap)
        {
            var nodeIter  = btree.AllNodeIds(transaction);
            var btreeSlot = idSystem.CommittedSlot(btree.GetID
                                                       ());

            slotMap.Add(btreeSlot);
            long usage = btreeSlot.Length();

            while (nodeIter.MoveNext())
            {
                var curNodeId = ((int)nodeIter.Current);
                var slot      = idSystem.CommittedSlot(curNodeId);
                slotMap.Add(slot);
                usage += slot.Length();
            }
            return(usage);
        }
コード例 #4
0
 public virtual Slot CommittedSlot(int id)
 {
     return(_delegate.CommittedSlot(id));
 }
コード例 #5
0
		private static long BTreeUsage(Transaction transaction, IIdSystem idSystem, BTree
			 btree, ISlotMap slotMap)
		{
			IEnumerator nodeIter = btree.AllNodeIds(transaction);
			Db4objects.Db4o.Internal.Slots.Slot btreeSlot = idSystem.CommittedSlot(btree.GetID
				());
			slotMap.Add(btreeSlot);
			long usage = btreeSlot.Length();
			while (nodeIter.MoveNext())
			{
				int curNodeId = ((int)nodeIter.Current);
				Db4objects.Db4o.Internal.Slots.Slot slot = idSystem.CommittedSlot(curNodeId);
				slotMap.Add(slot);
				usage += slot.Length();
			}
			return usage;
		}
コード例 #6
0
 private static long BTreeUsage(Transaction transaction, IIdSystem idSystem, BTree
     btree, ISlotMap slotMap)
 {
     var nodeIter = btree.AllNodeIds(transaction);
     var btreeSlot = idSystem.CommittedSlot(btree.GetID
         ());
     slotMap.Add(btreeSlot);
     long usage = btreeSlot.Length();
     while (nodeIter.MoveNext())
     {
         var curNodeId = ((int) nodeIter.Current);
         var slot = idSystem.CommittedSlot(curNodeId);
         slotMap.Add(slot);
         usage += slot.Length();
     }
     return usage;
 }