Esempio n. 1
0
 public BTree(Transaction trans, BTreeConfiguration config, int id, IIndexable4 keyHandler
              , int treeNodeSize) : base(config._idSystem)
 {
     _config = config;
     if (null == keyHandler)
     {
         throw new ArgumentNullException();
     }
     _nodeSize     = treeNodeSize;
     _nodeCache    = CacheFactory.NewLRUIntCache(config._cacheSize);
     _halfNodeSize = _nodeSize / 2;
     _nodeSize     = _halfNodeSize * 2;
     _keyHandler   = keyHandler;
     SetID(id);
     if (IsNew())
     {
         SetStateDirty();
         _root = new BTreeNode(this, 0, true, 0, 0, 0);
         _root.Write(trans.SystemTransaction());
         AddNode(_root);
         Write(trans.SystemTransaction());
     }
     else
     {
         SetStateDeactivated();
     }
 }
Esempio n. 2
0
		public BTree(Transaction trans, BTreeConfiguration config, int id, IIndexable4 keyHandler
			, int treeNodeSize) : base(config._idSystem)
		{
			_config = config;
			if (null == keyHandler)
			{
				throw new ArgumentNullException();
			}
			_nodeSize = treeNodeSize;
			_nodeCache = CacheFactory.NewLRUIntCache(config._cacheSize);
			_halfNodeSize = _nodeSize / 2;
			_nodeSize = _halfNodeSize * 2;
			_keyHandler = keyHandler;
			SetID(id);
			if (IsNew())
			{
				SetStateDirty();
				_root = new BTreeNode(this, 0, true, 0, 0, 0);
				_root.Write(trans.SystemTransaction());
				AddNode(_root);
				Write(trans.SystemTransaction());
			}
			else
			{
				SetStateDeactivated();
			}
		}
Esempio n. 3
0
 public SynchronizedCache(ICache4 <TKey, TValue> implementation)
 {
     if (null == implementation)
     {
         throw new ArgumentNullException("implementation");
     }
     this.implementation = implementation;
 }
Esempio n. 4
0
        public virtual void TestProduce()
        {
            object  obj   = new object();
            ICache4 cache = ((ICache4)SubjectFixtureProvider.Value());
            object  value = cache.Produce(1, new _IFunction4_39(obj), null);

            Assert.AreSame(obj, value);
            Assert.AreSame(obj, cache.Produce(1, null, null));
        }
Esempio n. 5
0
 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 public CachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize) : base(bin
                                                                                )
 {
     _onDiscardPage    = new _IProcedure4_22(this);
     _producerFromDisk = new _IFunction4_138(this);
     _producerFromPool = new _IFunction4_147(this);
     _pageSize         = pageSize;
     _pagePool         = new SimpleObjectPool(NewPagePool(pageCount));
     _cache            = cache;
     _fileLength       = _bin.Length();
 }
Esempio n. 6
0
		/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
		public CachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize) : base(bin
			)
		{
			_onDiscardPage = new _IProcedure4_22(this);
			_producerFromDisk = new _IFunction4_138(this);
			_producerFromPool = new _IFunction4_147(this);
			_pageSize = pageSize;
			_pagePool = new SimpleObjectPool(NewPagePool(pageCount));
			_cache = cache;
			_fileLength = _bin.Length();
		}
Esempio n. 7
0
 public static ICache4 <TKey, TValue> For(ICache4 cache4, IEqualityComparer <TKey> comparer)
 {
     return(new Cache4CachingStrategyWithComparer <TKey, TValue>(cache4, comparer));
 }
Esempio n. 8
0
 public static ICache4 <TKey, TValue> For(ICache4 cache4)
 {
     return(new Cache4CachingStrategy <TKey, TValue>(cache4));
 }
Esempio n. 9
0
 public TracingCacheDecorator(ICache4 <TKey, TValue> @delegate)
 {
     _delegate = @delegate;
 }
Esempio n. 10
0
 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 public NonFlushingCachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize
                              ) : base(bin, cache, pageCount, pageSize)
 {
 }
        private MetadataResolver()
        {
            _assemblyCache = CacheFactory <Assembly, AssemblyDefinition> .For(CacheFactory.New2QXCache(5));

            _methodCache = CacheFactory <MethodInfo, MethodDefinition> .For(CacheFactory.New2QXCache(5));
        }
Esempio n. 12
0
		private MetadataResolver()
		{
			_assemblyCache = CacheFactory<Assembly, AssemblyDefinition>.For(CacheFactory.New2QXCache(5));
			_methodCache = CacheFactory<MethodInfo, MethodDefinition>.For(CacheFactory.New2QXCache(5));
		}
Esempio n. 13
0
		public CacheStatistics(ICache4 delegate_)
		{
			_delegate = delegate_;
		}
 public CacheStatistics(ICache4 delegate_)
 {
     _delegate = delegate_;
 }
Esempio n. 15
0
			/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
			public NonFlushingCachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize
				) : base(bin, cache, pageCount, pageSize)
			{
			}
Esempio n. 16
0
 public Cache4CachingStrategy(ICache4 cache4)
 {
     _cache4 = cache4;
 }
Esempio n. 17
0
 public Cache4CachingStrategyWithComparer(ICache4 cache4, IEqualityComparer <TKey> comparer) : base(cache4)
 {
     _comparer = comparer;
 }
Esempio n. 18
0
 private static ICache4 <TKey, TValue> SynchonizedCache(ICache4 <TKey, TValue> cacheImplementation)
 {
     return(new SynchronizedCache <TKey, TValue>(cacheImplementation));
 }