예제 #1
0
        private void InitializeNew()
        {
            _bTree = new BTree(Transaction(), BTreeConfiguration(), new BTreeIdSystem.IdSlotMappingHandler
                                   ());
            int idGeneratorValue = _container.Handlers.LowestValidId() - 1;

            _persistentState = new PersistentIntegerArray(SlotChangeFactory.IdSystem, _transactionalIdSystem
                                                          , new int[] { _bTree.GetID(), idGeneratorValue, 0 });
            _persistentState.Write(Transaction());
            _parentIdSystem.ChildId(_persistentState.GetID());
        }
예제 #2
0
		public BTreeIdSystem(LocalObjectContainer container, IStackableIdSystem parentIdSystem
			, int maxValidId)
		{
			_container = container;
			_parentIdSystem = parentIdSystem;
			_transactionalIdSystem = container.NewTransactionalIdSystem(null, new _IClosure4_40
				(parentIdSystem));
			int persistentArrayId = parentIdSystem.ChildId();
			if (persistentArrayId == 0)
			{
				InitializeNew();
			}
			else
			{
				InitializeExisting(persistentArrayId);
			}
			_idGenerator = new SequentialIdGenerator(new _IFunction4_52(this), IdGeneratorValue
				(), _container.Handlers.LowestValidId(), maxValidId);
		}
예제 #3
0
        public BTreeIdSystem(LocalObjectContainer container, IStackableIdSystem parentIdSystem
                             , int maxValidId)
        {
            _container             = container;
            _parentIdSystem        = parentIdSystem;
            _transactionalIdSystem = container.NewTransactionalIdSystem(null, new _IClosure4_40
                                                                            (parentIdSystem));
            int persistentArrayId = parentIdSystem.ChildId();

            if (persistentArrayId == 0)
            {
                InitializeNew();
            }
            else
            {
                InitializeExisting(persistentArrayId);
            }
            _idGenerator = new SequentialIdGenerator(new _IFunction4_52(this), IdGeneratorValue
                                                         (), _container.Handlers.LowestValidId(), maxValidId);
        }