示例#1
0
			public _IVisitor4_27(IdSlotChanges _enclosing, FreespaceCommitter freespaceCommitter
				, bool forFreespace)
			{
				this._enclosing = _enclosing;
				this.freespaceCommitter = freespaceCommitter;
				this.forFreespace = forFreespace;
			}
		public virtual void Commit(FreespaceCommitter freespaceCommitter)
		{
			IVisitable slotChangeVisitable = new _IVisitable_52(this);
			freespaceCommitter.TransactionalIdSystem(this);
			AccumulateFreeSlots(freespaceCommitter, false);
			GlobalIdSystem().Commit(slotChangeVisitable, freespaceCommitter);
		}
示例#3
0
		public virtual void AccumulateFreeSlot(TransactionalIdSystemImpl idSystem, FreespaceCommitter
			 freespaceCommitter, bool forFreespace)
		{
			if (ForFreespace() != forFreespace)
			{
				return;
			}
			if (_firstOperation == SlotChange.SlotChangeOperation.create)
			{
				return;
			}
			if (_currentOperation == SlotChange.SlotChangeOperation.update || _currentOperation
				 == SlotChange.SlotChangeOperation.delete)
			{
				Slot slot = ModifiedSlotInParentIdSystem(idSystem);
				if (Slot.IsNull(slot))
				{
					slot = idSystem.CommittedSlot(_key);
				}
				// No old slot at all can be the case if the object
				// has been deleted by another transaction and we add it again.
				if (!Slot.IsNull(slot))
				{
					freespaceCommitter.DelayedFree(slot, FreeToSystemFreespaceSystem());
				}
			}
		}
		public void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter)
		{
			Slot reservedSlot = _transactionLogHandler.AllocateSlot(false, CountSlotChanges(slotChanges
				));
			freespaceCommitter.Commit();
			_transactionLogHandler.ApplySlotChanges(slotChanges, CountSlotChanges(slotChanges
				), reservedSlot);
		}
 public virtual void AccumulateFreeSlots(FreespaceCommitter accumulator, bool forFreespace
     )
 {
     _slotChanges.AccumulateFreeSlots(accumulator, forFreespace, IsSystemIdSystem());
     if (_parentIdSystem != null)
     {
         _parentIdSystem.AccumulateFreeSlots(accumulator, forFreespace);
     }
 }
		public override void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter
			)
		{
			if (TriggersException())
			{
				_exceptionFactory.ThrowException();
			}
			base.Commit(slotChanges, freespaceCommitter);
		}
示例#7
0
		// do nothing
		public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter
			)
		{
			Slot oldSlot = _slot;
			Slot reservedSlot = AllocateSlot(false, EstimatedSlotLength(EstimateMappingCount(
				slotChanges)));
			// No more operations against the FreespaceManager.
			// Time to free old slots.
			freespaceCommitter.Commit();
			slotChanges.Accept(new _IVisitor4_69(this));
			WriteThis(reservedSlot);
			FreeSlot(oldSlot);
		}
示例#8
0
		public void AccumulateFreeSlots(FreespaceCommitter freespaceCommitter, bool forFreespace
			, bool traverseMutable)
		{
			IVisitor4 visitor = new _IVisitor4_27(this, freespaceCommitter, forFreespace);
			if (traverseMutable)
			{
				_slotChanges.TraverseMutable(visitor);
			}
			else
			{
				_slotChanges.TraverseLocked(visitor);
			}
		}
示例#9
0
        public void AccumulateFreeSlots(FreespaceCommitter freespaceCommitter, bool forFreespace
                                        , bool traverseMutable)
        {
            IVisitor4 visitor = new _IVisitor4_27(this, freespaceCommitter, forFreespace);

            if (traverseMutable)
            {
                _slotChanges.TraverseMutable(visitor);
            }
            else
            {
                _slotChanges.TraverseLocked(visitor);
            }
        }
示例#10
0
        // do nothing
        public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter
                                   )
        {
            Slot oldSlot      = _slot;
            Slot reservedSlot = AllocateSlot(false, EstimatedSlotLength(EstimateMappingCount(
                                                                            slotChanges)));

            // No more operations against the FreespaceManager.
            // Time to free old slots.
            freespaceCommitter.Commit();
            slotChanges.Accept(new _IVisitor4_69(this));
            WriteThis(reservedSlot);
            FreeSlot(oldSlot);
        }
示例#11
0
		public override void AccumulateFreeSlot(TransactionalIdSystemImpl idSystem, FreespaceCommitter
			 freespaceCommitter, bool forFreespace)
		{
			if (ForFreespace() != forFreespace)
			{
				return;
			}
			base.AccumulateFreeSlot(idSystem, freespaceCommitter, forFreespace);
			if (_freed == null)
			{
				return;
			}
			IEnumerator iterator = _freed.GetEnumerator();
			while (iterator.MoveNext())
			{
				freespaceCommitter.DelayedFree((Slot)iterator.Current, FreeToSystemFreespaceSystem
					());
			}
		}
示例#12
0
 public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter
                            )
 {
     _container.FreespaceManager().BeginCommit();
     slotChanges.Accept(new _IVisitor4_129(this));
     // TODO: Maybe we want a BTree that doesn't allow duplicates.
     // Then we could do the following in one step without removing first.
     _bTree.Commit(Transaction());
     IdGeneratorValue(_idGenerator.PersistentGeneratorValue());
     if (_idGenerator.IsDirty())
     {
         _idGenerator.SetClean();
         _persistentState.SetStateDirty();
     }
     if (_persistentState.IsDirty())
     {
         _persistentState.Write(Transaction());
     }
     _container.FreespaceManager().EndCommit();
     _transactionalIdSystem.Commit(freespaceCommitter);
     _transactionalIdSystem.Clear();
 }
示例#13
0
		public void Commit(FreespaceCommitter accumulator)
		{
		}
示例#14
0
		public void AccumulateFreeSlots(FreespaceCommitter freespaceCommitter, bool forFreespace
			)
		{
		}
		public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter
			)
		{
			_container.FreespaceManager().BeginCommit();
			slotChanges.Accept(new _IVisitor4_129(this));
			// TODO: Maybe we want a BTree that doesn't allow duplicates.
			// Then we could do the following in one step without removing first.
			_bTree.Commit(Transaction());
			IdGeneratorValue(_idGenerator.PersistentGeneratorValue());
			if (_idGenerator.IsDirty())
			{
				_idGenerator.SetClean();
				_persistentState.SetStateDirty();
			}
			if (_persistentState.IsDirty())
			{
				_persistentState.Write(Transaction());
			}
			_container.FreespaceManager().EndCommit();
			_transactionalIdSystem.Commit(freespaceCommitter);
			_transactionalIdSystem.Clear();
		}
		public override void AccumulateFreeSlot(TransactionalIdSystemImpl idSystem, FreespaceCommitter
			 freespaceCommitter, bool forFreespace)
		{
			base.AccumulateFreeSlot(idSystem, freespaceCommitter, forFreespace);
		}
示例#17
0
 public void AccumulateFreeSlots(FreespaceCommitter freespaceCommitter, bool forFreespace
                                 )
 {
 }
示例#18
0
		public virtual void CommitIds()
		{
			FreespaceCommitter freespaceCommitter = new FreespaceCommitter(_targetDb.FreespaceManager
				());
			freespaceCommitter.TransactionalIdSystem(SystemTrans().IdSystem());
			_targetDb.IdSystem().Commit(Mapping().SlotChanges(), freespaceCommitter);
			freespaceCommitter.Commit();
		}
示例#19
0
 public void Commit(FreespaceCommitter accumulator)
 {
 }
示例#20
0
		public virtual void Commit(IVisitable slotChanges, FreespaceCommitter freespaceCommitter
			)
		{
			_delegate.Commit(slotChanges, freespaceCommitter);
		}