亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bplustreebytes.cs

?? R樹與B樹的混合樹
?? CS
字號:
using System;
using System.Collections;

namespace BplusDotNet
{
	/// <summary>
	/// BPlus tree implementation mapping strings to bytes with fixed key length
	/// </summary>
	public class BplusTreeBytes : IByteTree
	{
		BplusTreeLong tree;
		LinkedFile archive;
		Hashtable FreeChunksOnCommit = new Hashtable();
		Hashtable FreeChunksOnAbort = new Hashtable();
		static int DEFAULTBLOCKSIZE = 1024;
		static int DEFAULTNODESIZE = 32;
		public BplusTreeBytes(BplusTreeLong tree, LinkedFile archive)
		{
			this.tree = tree;
			this.archive = archive;
		}

		public static BplusTreeBytes Initialize(string treefileName, string blockfileName, int KeyLength, int CultureId,
			int nodesize, int buffersize) 
		{
			System.IO.Stream treefile = new System.IO.FileStream(treefileName, System.IO.FileMode.CreateNew, 
				System.IO.FileAccess.ReadWrite);
			System.IO.Stream blockfile = new System.IO.FileStream(blockfileName, System.IO.FileMode.CreateNew, 
				System.IO.FileAccess.ReadWrite);
			return Initialize(treefile, blockfile, KeyLength, CultureId, nodesize, buffersize);
		}
		public static BplusTreeBytes Initialize(string treefileName, string blockfileName, int KeyLength, int CultureId) 
		{
			System.IO.Stream treefile = new System.IO.FileStream(treefileName, System.IO.FileMode.CreateNew, 
				System.IO.FileAccess.ReadWrite);
			System.IO.Stream blockfile = new System.IO.FileStream(blockfileName, System.IO.FileMode.CreateNew, 
				System.IO.FileAccess.ReadWrite);
			return Initialize(treefile, blockfile, KeyLength, CultureId);
		}
		public static BplusTreeBytes Initialize(string treefileName, string blockfileName, int KeyLength) 
		{
			System.IO.Stream treefile = new System.IO.FileStream(treefileName, System.IO.FileMode.CreateNew, 
				System.IO.FileAccess.ReadWrite);
			System.IO.Stream blockfile = new System.IO.FileStream(blockfileName, System.IO.FileMode.CreateNew, 
				System.IO.FileAccess.ReadWrite);
			return Initialize(treefile, blockfile, KeyLength);
		}
		public static BplusTreeBytes Initialize(System.IO.Stream treefile, System.IO.Stream blockfile, int KeyLength, int CultureId,
			int nodesize, int buffersize) 
		{
			BplusTreeLong tree = BplusTreeLong.InitializeInStream(treefile, KeyLength, nodesize, CultureId);
			LinkedFile archive = LinkedFile.InitializeLinkedFileInStream(blockfile, buffersize);
			return new BplusTreeBytes(tree, archive);
		}
		public static BplusTreeBytes Initialize(System.IO.Stream treefile, System.IO.Stream blockfile, int KeyLength, int CultureId) 
		{
			return Initialize(treefile, blockfile, KeyLength, CultureId, DEFAULTNODESIZE, DEFAULTBLOCKSIZE);
		}
		public static BplusTreeBytes Initialize(System.IO.Stream treefile, System.IO.Stream blockfile, int KeyLength) 
		{
			int CultureId = System.Globalization.CultureInfo.InvariantCulture.LCID;
			return Initialize(treefile, blockfile, KeyLength, CultureId, DEFAULTNODESIZE, DEFAULTBLOCKSIZE);
		}
		public static BplusTreeBytes ReOpen(System.IO.Stream treefile, System.IO.Stream blockfile) 
		{
			BplusTreeLong tree = BplusTreeLong.SetupFromExistingStream(treefile);
			LinkedFile archive = LinkedFile.SetupFromExistingStream(blockfile);
			return new BplusTreeBytes(tree, archive);
		}
		public static BplusTreeBytes ReOpen(string treefileName, string blockfileName, System.IO.FileAccess access) 
		{
			System.IO.Stream treefile = new System.IO.FileStream(treefileName, System.IO.FileMode.Open, 
				access);
			System.IO.Stream blockfile = new System.IO.FileStream(blockfileName, System.IO.FileMode.Open, 
				access);
			return ReOpen(treefile, blockfile);
		}
		public static BplusTreeBytes ReOpen(string treefileName, string blockfileName) 
		{
			return ReOpen(treefileName, blockfileName, System.IO.FileAccess.ReadWrite);
		}
		public static BplusTreeBytes ReadOnly(string treefileName, string blockfileName)
		{
			return ReOpen(treefileName, blockfileName, System.IO.FileAccess.Read);
		}

		/// <summary>
		/// Use non-culture sensitive total order on binary strings.
		/// </summary>
		public void NoCulture() 
		{
			this.tree.DontUseCulture = true;
			this.tree.cultureContext = null;
		}
		public int MaxKeyLength() 
		{
			return this.tree.MaxKeyLength();
		}
		#region ITreeIndex Members

		
		public int Compare(string left, string right) 
		{
			return this.tree.Compare(left, right);
		}
		public void Shutdown()
		{
			this.tree.Shutdown();
			this.archive.Shutdown();
		}

		public void Recover(bool CorrectErrors)
		{
			this.tree.Recover(CorrectErrors);
			Hashtable ChunksInUse = new Hashtable();
			string key = this.tree.FirstKey();
			while (key!=null) 
			{
				long buffernumber = this.tree[key];
				if (ChunksInUse.ContainsKey(buffernumber)) 
				{
					throw new BplusTreeException("buffer number "+buffernumber+" associated with more than one key '"
						+key+"' and '"+ChunksInUse[buffernumber]+"'");
				}
				ChunksInUse[buffernumber] = key;
				key = this.tree.NextKey(key);
			}
			// also consider the un-deallocated chunks to be in use
			foreach (DictionaryEntry thing in this.FreeChunksOnCommit) 
			{
				long buffernumber = (long) thing.Key;
				ChunksInUse[buffernumber] = "awaiting commit";
			}
			this.archive.Recover(ChunksInUse, CorrectErrors);
		}

		public void RemoveKey(string key)
		{
			long map = this.tree[key];
			//this.archive.ReleaseBuffers(map);
			//this.FreeChunksOnCommit.Add(map);
			if (this.FreeChunksOnAbort.ContainsKey(map)) 
			{
				// free it now
				this.FreeChunksOnAbort.Remove(map);
				this.archive.ReleaseBuffers(map);
			} 
			else 
			{
				// free when committed
				this.FreeChunksOnCommit[map] = map;
			}
			this.tree.RemoveKey(key);
		}

		public string FirstKey()
		{
			return this.tree.FirstKey();
		}

		public string NextKey(string AfterThisKey)
		{
			return this.tree.NextKey(AfterThisKey);
		}

		public bool ContainsKey(string key)
		{
			return this.tree.ContainsKey(key);
		}

		public object Get(string key, object defaultValue)
		{
			long map;
			if (this.tree.ContainsKey(key, out map)) 
			{
				return (object) this.archive.GetChunk(map);
			}
			return defaultValue;
		}

		public void Set(string key, object map)
		{
			if (!(map is byte[]) )
			{
				throw new BplusTreeBadKeyValue("BplusTreeBytes can only archive byte array as value");
			}
			byte[] thebytes = (byte[]) map;
			this[key] = thebytes;
		}
		public byte[] this[string key] 
		{
			set 
			{
				long storage = this.archive.StoreNewChunk(value, 0, value.Length);
				//this.FreeChunksOnAbort.Add(storage);
				this.FreeChunksOnAbort[storage] = storage;
				long valueFound;
				if (this.tree.ContainsKey(key, out valueFound)) 
				{
					//this.archive.ReleaseBuffers(valueFound);
					if (this.FreeChunksOnAbort.ContainsKey(valueFound)) 
					{
						// free it now
						this.FreeChunksOnAbort.Remove(valueFound);
						this.archive.ReleaseBuffers(valueFound);
					} 
					else 
					{
						// release at commit.
						this.FreeChunksOnCommit[valueFound] = valueFound;
					}
				}
				this.tree[key] = storage;
			}
			get 
			{
				long map = this.tree[key];
				return this.archive.GetChunk(map);
			}
		}

		public void Commit()
		{
			// store all new bufferrs
			this.archive.Flush();
			// commit the tree
			this.tree.Commit();
			// at this point the new buffers have been committed, now free the old ones
			//this.FreeChunksOnCommit.Sort();
			ArrayList toFree = new ArrayList();
			foreach (DictionaryEntry d in this.FreeChunksOnCommit) 
			{
				toFree.Add(d.Key);
			}
			toFree.Sort();
			toFree.Reverse();
			foreach (object thing in toFree) 
			{
				long chunknumber = (long) thing;
				this.archive.ReleaseBuffers(chunknumber);
			}
			this.archive.Flush();
			this.ClearBookKeeping();
		}

		public void Abort()
		{
			//this.FreeChunksOnAbort.Sort();
			ArrayList toFree = new ArrayList();
			foreach (DictionaryEntry d in this.FreeChunksOnAbort) 
			{
				toFree.Add(d.Key);
			}
			toFree.Sort();
			toFree.Reverse();
			foreach (object thing in toFree) 
			{
				long chunknumber = (long) thing;
				this.archive.ReleaseBuffers(chunknumber);
			}
			this.tree.Abort();
			this.archive.Flush();
			this.ClearBookKeeping();
		}
		
		public void SetFootPrintLimit(int limit) 
		{
			this.tree.SetFootPrintLimit(limit);
		}

		void ClearBookKeeping() 
		{
			this.FreeChunksOnCommit.Clear();
			this.FreeChunksOnAbort.Clear();
		}

		#endregion

		public string toHtml() 
		{
			string treehtml = this.tree.toHtml();
			System.Text.StringBuilder sb = new System.Text.StringBuilder();
			sb.Append(treehtml);
			sb.Append("\r\n<br> free on commit "+this.FreeChunksOnCommit.Count+" ::");
			foreach (DictionaryEntry thing in this.FreeChunksOnCommit) 
			{
				sb.Append(" "+thing.Key);
			}
			sb.Append("\r\n<br> free on abort "+this.FreeChunksOnAbort.Count+" ::");
			foreach (DictionaryEntry thing in this.FreeChunksOnAbort) 
			{
				sb.Append(" "+thing.Key);
			}
			return sb.ToString(); // archive info not included
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品1024久久| 亚洲天堂免费看| 美女视频一区二区| 日韩免费成人网| 激情五月婷婷综合网| 久久久国产精品麻豆 | 亚洲综合区在线| 91久久奴性调教| 视频一区二区国产| 欧美刺激午夜性久久久久久久| 日本不卡不码高清免费观看| 久久久亚洲午夜电影| 不卡视频在线观看| 亚洲成人免费看| 欧美mv日韩mv| 91视频xxxx| 欧美a级理论片| 欧美激情一区二区三区不卡| 一本色道久久综合精品竹菊| 天天综合网天天综合色| 精品理论电影在线观看| 成人av在线资源网站| 亚洲大片在线观看| 精品区一区二区| a美女胸又www黄视频久久| 亚洲电影欧美电影有声小说| 精品日韩一区二区三区| jlzzjlzz亚洲女人18| 午夜视频在线观看一区二区三区| 精品少妇一区二区三区免费观看 | 久久综合丝袜日本网| 成人福利在线看| 亚洲成人动漫一区| 国产午夜精品美女毛片视频| 91久久香蕉国产日韩欧美9色| 久久精品国产**网站演员| 中文字幕一区二区三区在线观看| 欧美视频在线一区| 国产福利一区二区三区视频 | 欧美蜜桃一区二区三区| 国产精品一区三区| 亚洲第一精品在线| 国产精品久久久久影院| 91精品国产全国免费观看| av一区二区三区四区| 蜜桃视频免费观看一区| 自拍av一区二区三区| 日韩精品一区二区三区四区视频 | 欧美va日韩va| 欧美亚洲高清一区| 国产suv精品一区二区三区| 亚洲成年人影院| 1区2区3区欧美| 2021中文字幕一区亚洲| 欧美日韩一区二区三区四区五区| 国产成人综合在线| 久久综合综合久久综合| 一区二区三区欧美在线观看| 国产女主播视频一区二区| 777午夜精品免费视频| 色综合一个色综合亚洲| 国产成人精品亚洲777人妖| 免费观看在线综合色| 亚洲va国产va欧美va观看| 亚洲人成影院在线观看| 国产精品私人影院| 亚洲国产高清在线| 久久久久久**毛片大全| 精品精品国产高清一毛片一天堂| 欧美日本在线播放| 欧美三级日韩三级国产三级| 91国内精品野花午夜精品| 波多野结衣欧美| 粉嫩av亚洲一区二区图片| 精品一区二区在线看| 麻豆国产精品官网| 喷白浆一区二区| 美女网站色91| 九九**精品视频免费播放| 麻豆高清免费国产一区| 青青草国产精品97视觉盛宴| 日韩av不卡在线观看| 奇米影视一区二区三区小说| 日本91福利区| 国内精品国产三级国产a久久| 久久精品久久精品| 国产综合色视频| 懂色av一区二区夜夜嗨| 成人黄色软件下载| 91精品福利在线| 欧美三级中文字| 日韩一级免费观看| 精品国产乱码久久| 中文字幕国产一区二区| 自拍视频在线观看一区二区| 一区二区在线观看视频| 日日噜噜夜夜狠狠视频欧美人 | 91精品国产高清一区二区三区蜜臀| 91福利在线免费观看| 欧美色图片你懂的| 欧美精品一二三| 欧美成人乱码一区二区三区| 精品国产乱子伦一区| 国产午夜精品一区二区| 亚洲人成网站影音先锋播放| 一区二区三区精品| 美女在线观看视频一区二区| 国产成人高清视频| 91色porny| 欧美一区二区三区思思人| 久久久久久久久伊人| 亚洲免费在线播放| 日韩精品久久理论片| 国产一区二区三区在线观看免费视频| 成人永久免费视频| 欧美人狂配大交3d怪物一区| 国产亚洲一二三区| 亚洲高清在线精品| 国产精品99久久久| 91成人免费电影| 337p粉嫩大胆噜噜噜噜噜91av| 国产精品久久久久aaaa樱花| 午夜精品福利视频网站| 成人在线视频首页| 91精品综合久久久久久| 国产精品福利影院| 日本v片在线高清不卡在线观看| 国产成人av电影在线| 欧美精品亚洲二区| 国产精品久久久久精k8| 蜜桃在线一区二区三区| 色悠悠亚洲一区二区| 久久午夜色播影院免费高清| 亚洲国产va精品久久久不卡综合 | 国产精品久久久久毛片软件| 日本不卡一区二区三区高清视频| 成人污视频在线观看| 日韩限制级电影在线观看| 亚洲私人黄色宅男| 国产精品中文欧美| 51精品国自产在线| 亚洲人成精品久久久久| 高清国产午夜精品久久久久久| 欧美午夜电影在线播放| 最新中文字幕一区二区三区| 狠狠色狠狠色合久久伊人| 在线不卡中文字幕播放| 亚洲日本中文字幕区| 国产成人av网站| 精品少妇一区二区三区视频免付费| 一区二区激情小说| 色婷婷av一区| 中文字幕亚洲欧美在线不卡| 国产99一区视频免费| 亚洲精品一线二线三线| 美腿丝袜一区二区三区| 欧美精品丝袜中出| 午夜天堂影视香蕉久久| 欧美在线影院一区二区| 自拍偷自拍亚洲精品播放| 成人av动漫在线| 国产欧美一区二区精品仙草咪| 国产在线观看一区二区| 日韩欧美一级二级| 久久狠狠亚洲综合| 欧美一区二区三区免费观看视频| 午夜欧美一区二区三区在线播放| 日本韩国欧美在线| 亚洲区小说区图片区qvod| 一本大道久久a久久综合婷婷| 中文字幕一区二区三区色视频 | 亚洲在线一区二区三区| 色国产精品一区在线观看| 一区二区三区在线视频观看| 色妞www精品视频| 亚洲黄色片在线观看| 在线观看视频欧美| 丝袜国产日韩另类美女| 欧美日本一区二区| 全部av―极品视觉盛宴亚洲| 日韩精品最新网址| 国内久久精品视频| 欧美极品aⅴ影院| 成人av免费在线观看| 亚洲视频你懂的| 欧美日韩免费不卡视频一区二区三区| 天天影视涩香欲综合网 | 91蜜桃婷婷狠狠久久综合9色| 日韩理论片中文av| 欧美性生活大片视频| 日韩影视精彩在线| 久久九九全国免费| 成人性生交大片免费| 亚洲精品日产精品乱码不卡| 欧美日韩国产大片| 国产一区在线视频| 亚洲视频免费看| 欧美一区在线视频| 国产成人免费视| 亚洲高清一区二区三区|