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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bplustreelong.cs

?? R樹與B樹的混合樹
?? CS
?? 第 1 頁 / 共 5 頁
字號(hào):
				this.ShrinkFootprint();
			}
		}
		public string FirstKey() 
		{
			string result = null;
			if (this.root!=null) 
			{
				// empty string is smallest possible tree
				if (this.ContainsKey("")) 
				{
					result = "";
				} 
				else 
				{
					return this.root.FindNextKey("");
				}
				this.ShrinkFootprint();
			}
			return result;
		}
		public string NextKey(string AfterThisKey) 
		{
			if (AfterThisKey==null) 
			{
				throw new BplusTreeBadKeyValue("cannot search for null string");
			}
			string result = this.root.FindNextKey(AfterThisKey);
			this.ShrinkFootprint();
			return result;
		}
		public bool ContainsKey(string key) 
		{
			long valueFound;
			return this.ContainsKey(key, out valueFound);
		} 
		public bool ContainsKey(string key, out long valueFound) 
		{
			if (key==null)
			{
				throw new BplusTreeBadKeyValue("cannot search for null string");
			}
			bool result = false;
			valueFound = (long) 0;
			if (this.root!=null) 
			{
				result = this.root.FindMatch(key, out valueFound);
			}
			this.ShrinkFootprint();
			return result;
		}
		public long Get(string key, long defaultValue) 
		{
			long result = defaultValue;
			long valueFound;
			if (this.ContainsKey(key, out valueFound))
			{
				result = valueFound;
			}
			return result;
		}
		public void Set(string key, object map) 
		{
			if (!(map is long)) 
			{
				throw new BplusTreeBadKeyValue("only longs may be used as values in a BplusTreeLong: "+map);
			}
			this[key] = (long) map;
		}
		public object Get(string key, object defaultValue) 
		{
			long valueFound;
			if (this.ContainsKey(key, out valueFound)) 
			{
				return (object) valueFound;
			}
			return defaultValue;
		}
		/// <summary>
		/// Store off any changed buffers, clear the fifo, free invalid buffers
		/// </summary>
		public void Commit() 
		{
			// store all modifications
			if (this.root!=null) 
			{
				this.rootSeek = this.root.Invalidate(false);
			}
			this.fromfile.Flush();
			// commit the new root
			this.setHeader();
			this.fromfile.Flush();
			// at this point the changes are committed, but some space is unreachable.
			// now free all unfreed buffers no longer in use
			ArrayList toFree = new ArrayList();
			foreach (DictionaryEntry d in this.FreeBuffersOnCommit) 
			{
				toFree.Add(d.Key);
			}
			toFree.Sort();
			toFree.Reverse();
			foreach (object thing in toFree) 
			{
				long buffernumber = (long) thing;
				this.deallocateBuffer(buffernumber);
			}
			// store the free list head
			this.setHeader();
			this.fromfile.Flush();
			this.ResetBookkeeping();
		}
		/// <summary>
		/// Forget all changes since last commit
		/// </summary>
		public void Abort() 
		{
			// deallocate allocated blocks
			ArrayList toFree = new ArrayList();
			foreach (DictionaryEntry d in this.FreeBuffersOnAbort) 
			{
				toFree.Add(d.Key);
			}
			toFree.Sort();
			toFree.Reverse();
			foreach (object thing in toFree) 
			{
				long buffernumber = (long) thing;
				this.deallocateBuffer(buffernumber);
			}
			long freehead = this.freeHeadSeek;
			// reread the header (except for freelist head)
			this.readHeader();
			// restore the root
			if (this.rootSeek==NULLBUFFERNUMBER) 
			{
				this.root = null; // nothing was committed
			} 
			else 
			{
				this.root.LoadFromBuffer(this.rootSeek);
			}
			this.ResetBookkeeping();
			this.freeHeadSeek = freehead;
			this.setHeader(); // store new freelist head
			this.fromfile.Flush();
		}
		void ResetBookkeeping() 
		{
			this.FreeBuffersOnCommit.Clear();
			this.FreeBuffersOnAbort.Clear();
			this.IdToTerminalNode.Clear();
			this.TerminalNodeToId.Clear();
		}
		public long allocateBuffer() 
		{
			long allocated = -1;
			if (this.freeHeadSeek==NULLBUFFERNUMBER) 
			{
				// should be written immediately after allocation
				allocated = this.buffers.nextBufferNumber();
				//System.Diagnostics.Debug.WriteLine("<br> allocating fresh buffer "+allocated);
				return allocated;
			}
			// get the free head data
			allocated = this.freeHeadSeek;
			this.freeHeadSeek = this.parseFreeBuffer(allocated);
			//System.Diagnostics.Debug.WriteLine("<br> recycling free buffer "+allocated);
			return allocated;
		}
		long parseFreeBuffer(long buffernumber) 
		{
			int freesize = 1+BufferFile.LONGSTORAGE;
			byte[] buffer = new byte[freesize];
			this.buffers.getBuffer(buffernumber, buffer, 0, freesize);
			if (buffer[0]!=FREE) 
			{
				throw new BplusTreeException("free buffer not marked free");
			}
			long result = BufferFile.RetrieveLong(buffer, 1);
			return result;
		}
		public void deallocateBuffer(long buffernumber) 
		{
			//System.Diagnostics.Debug.WriteLine("<br> deallocating "+buffernumber);
			int freesize = 1+BufferFile.LONGSTORAGE;
			byte[] buffer = new byte[freesize];
			// it better not already be marked free
			this.buffers.getBuffer(buffernumber, buffer, 0, 1);
			if (buffer[0]==FREE) 
			{
				throw new BplusTreeException("attempt to re-free free buffer not allowed");
			}
			buffer[0] = FREE;
			BufferFile.Store(this.freeHeadSeek, buffer, 1);
			this.buffers.setBuffer(buffernumber, buffer, 0, freesize);
			this.freeHeadSeek = buffernumber;
		}
		void setHeader() 
		{
			byte[] header = this.makeHeader();
			this.fromfile.Seek(this.seekStart, System.IO.SeekOrigin.Begin);
			this.fromfile.Write(header, 0, header.Length);
		}
		public void RecordTerminalNode(BplusNode terminalNode) 
		{
			if (terminalNode==this.root) 
			{
				return; // never record the root node
			}
			if (this.TerminalNodeToId.ContainsKey(terminalNode) )
			{
				return; // don't record it again
			}
			int id = this.TerminalNodeCount;
			this.TerminalNodeCount++;
			this.TerminalNodeToId[terminalNode] = id;
			this.IdToTerminalNode[id] = terminalNode;
		}
		public void ForgetTerminalNode(BplusNode nonterminalNode) 
		{
			if (!this.TerminalNodeToId.ContainsKey(nonterminalNode)) 
			{
				// silently ignore (?)
				return;
			}
			int id = (int) this.TerminalNodeToId[nonterminalNode];
			if (id == this.LowerTerminalNodeCount) 
			{
				this.LowerTerminalNodeCount++;
			}
			this.IdToTerminalNode.Remove(id);
			this.TerminalNodeToId.Remove(nonterminalNode);
		}
		public void ShrinkFootprint() 
		{
			this.InvalidateTerminalNodes(this.FifoLimit);
		}
		public void InvalidateTerminalNodes(int toLimit) 
		{
			while (this.TerminalNodeToId.Count>toLimit) 
			{
				// choose oldest nonterminal and deallocate it
				while (!this.IdToTerminalNode.ContainsKey(this.LowerTerminalNodeCount)) 
				{
					this.LowerTerminalNodeCount++; // since most nodes are terminal this should usually be a short walk
					//System.Diagnostics.Debug.WriteLine("<BR>WALKING "+this.LowerTerminalNodeCount);
					//System.Console.WriteLine("<BR>WALKING "+this.LowerTerminalNodeCount);
					if (this.LowerTerminalNodeCount>this.TerminalNodeCount) 
					{
						throw new BplusTreeException("internal error counting nodes, lower limit went too large");
					}
				}
				//System.Console.WriteLine("<br> done walking");
				int id = this.LowerTerminalNodeCount;
				BplusNode victim = (BplusNode) this.IdToTerminalNode[id];
				//System.Diagnostics.Debug.WriteLine("\r\n<br>selecting "+victim.myBufferNumber+" for deallocation from fifo");
				this.IdToTerminalNode.Remove(id);
				this.TerminalNodeToId.Remove(victim);
				if (victim.myBufferNumber!=NULLBUFFERNUMBER) 
				{
					victim.Invalidate(true);
				}
			}
		}
		void readHeader() 
		{
			// prefix | version | node size | key size | culture id | buffer number of root | buffer number of free list head
			byte[] header = new byte[this.headersize];
			this.fromfile.Seek(this.seekStart, System.IO.SeekOrigin.Begin);
			this.fromfile.Read(header, 0, this.headersize);
			int index = 0;
			// check prefix
			foreach (byte b in HEADERPREFIX) 
			{
				if (header[index]!=b) 
				{
					throw new BufferFileException("invalid header prefix");
				}
				index++;
			}
			// skip version (for now)
			index++;
			this.NodeSize = BufferFile.Retrieve(header, index);
			index+= BufferFile.INTSTORAGE;
			this.KeyLength = BufferFile.Retrieve(header, index);
			index+= BufferFile.INTSTORAGE;
			int CultureId = BufferFile.Retrieve(header, index);
			this.cultureContext = new System.Globalization.CultureInfo(CultureId);
			index+= BufferFile.INTSTORAGE;
			this.rootSeek = BufferFile.RetrieveLong(header, index);
			index+= BufferFile.LONGSTORAGE;
			this.freeHeadSeek = BufferFile.RetrieveLong(header, index);
			this.SanityCheck();
			//this.header = header;
		}
		public byte[] makeHeader() 
		{
			// prefix | version | node size | key size | culture id | buffer number of root | buffer number of free list head
			byte[] result = new byte[this.headersize];
			HEADERPREFIX.CopyTo(result, 0);
			result[HEADERPREFIX.Length] = VERSION;
			int index = HEADERPREFIX.Length+1;
			BufferFile.Store(this.NodeSize, result, index);
			index+= BufferFile.INTSTORAGE;
			BufferFile.Store(this.KeyLength, result, index);
			index+= BufferFile.INTSTORAGE;
			if (this.cultureContext!=null) 
			{
				BufferFile.Store(this.cultureContext.LCID, result, index);
			} 
			else 
			{
				BufferFile.Store(System.Globalization.CultureInfo.InvariantCulture.LCID, result, index);
			}
			index+= BufferFile.INTSTORAGE;
			BufferFile.Store(this.rootSeek, result, index);
			index+= BufferFile.LONGSTORAGE;
			BufferFile.Store(this.freeHeadSeek, result, index);
			return result;
		}
	}
	public class BplusNode 
	{
		public bool isLeaf = true;
		// the maximum number of children to each node.
		int Size;
		// false if the node is no longer active and should not be used.
		//bool isValid = true;
		// true if the materialized node needs to be persisted.
		bool Dirty = true;
		// if non-root reference to the parent node containing this node
		BplusNode parent = null;
		// tree containing this node
		BplusTreeLong owner = null;
		// buffer number of this node
		public long myBufferNumber = BplusTreeLong.NULLBUFFERNUMBER;
		// number of children used by this node
		//int NumberOfValidKids = 0;
		long[] ChildBufferNumbers;
		string[] ChildKeys;
		BplusNode[] MaterializedChildNodes;
		int indexInParent = -1;
		/// <summary>
		/// Create a new BplusNode and install in parent if parent is not null.
		/// </summary>
		/// <param name="owner">tree containing the node</param>
		/// <param name="parent">parent node (if provided)</param>
		/// <param name="indexInParent">location in parent if provided</param>
		public BplusNode(BplusTreeLong owner, BplusNode parent, int indexInParent, bool isLeaf) 
		{
			this.isLeaf = isLeaf;
			this.owner = owner;
			this.parent = parent;
			this.Size = owner.NodeSize;
			//this.isValid = true;
			this.Dirty = true;
			//			this.ChildBufferNumbers = new long[this.Size+1];
			//			this.ChildKeys = new string[this.Size];
			//			this.MaterializedChildNodes = new BplusNode[this.Size+1];
			this.Clear();
			if (parent!=null && indexInParent>=0) 
			{
				if (indexInParent>this.Size) 
				{
					throw new BplusTreeException("parent index too large");
				}
				// key info, etc, set elsewhere
				this.parent.MaterializedChildNodes[indexInParent] = this;
				this.myBufferNumber = this.parent.ChildBufferNumbers[indexInParent];
				this.indexInParent = indexInParent;
			}
		}
		public BplusNode FirstChild() 
		{
			BplusNode result = this.MaterializeNodeAtIndex(0);
			if (result==null) 
			{
				throw new BplusTreeException("no first child");
			}
			return result;
		}
		public long makeRoot() 
		{
			this.parent = null;
			this.indexInParent = -1;
			if (this.myBufferNumber==BplusTreeLong.NULLBUFFERNUMBER) 
			{
				throw new BplusTreeException("no root seek allocated to new root");
			}
			return this.myBufferNumber;
		}
		public void Free() 
		{
			if (this.myBufferNumber!=BplusTreeLong.NULLBUFFERNUMBER) 
			{
				if (this.owner.FreeBuffersOnAbort.ContainsKey(this.myBufferNumber)) 
				{
					// free it now
					this.owner.FreeBuffersOnAbort.Remove(this.myBufferNumber);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美电影一区二区三区| 国产精品伦一区| 色老汉av一区二区三区| 日韩激情视频在线观看| 中文字幕在线观看不卡| 这里只有精品免费| 91在线视频观看| 麻豆国产欧美日韩综合精品二区 | 国产精品日日摸夜夜摸av| 欧美亚洲综合网| 国产高清视频一区| 免费看欧美女人艹b| 夜夜精品浪潮av一区二区三区| 亚洲精品在线免费播放| 欧美一区二区三区在线电影| 91免费小视频| 成人av手机在线观看| 国产一区二区不卡老阿姨| 日本欧美在线观看| 午夜精品爽啪视频| 一区二区三区免费在线观看| 久久精品欧美日韩精品| 日韩精品一区二区三区视频在线观看| 欧美在线短视频| 91国产视频在线观看| 成人av电影在线播放| 国产一区二区三区黄视频 | 九九精品视频在线看| 中文字幕精品一区| 精品美女一区二区| 欧美精品高清视频| 一本色道a无线码一区v| 夫妻av一区二区| 热久久一区二区| 亚洲成人黄色小说| 亚洲欧美日本韩国| 亚洲欧洲在线观看av| 久久久精品中文字幕麻豆发布| 欧美喷潮久久久xxxxx| 日本精品一区二区三区四区的功能| 国产在线播放一区三区四| 免费在线观看视频一区| 亚洲伊人色欲综合网| 中文字幕欧美一区| 亚洲图片欧美激情| 国产精品卡一卡二| 国产精品激情偷乱一区二区∴| 日韩一区二区三区观看| 欧美专区日韩专区| 69p69国产精品| 成人免费毛片嘿嘿连载视频| 国产精品亚洲第一| 久久精品国产精品亚洲红杏| 美女久久久精品| 蜜臀精品久久久久久蜜臀| 日韩中文欧美在线| 日韩va亚洲va欧美va久久| 日韩高清一区二区| 日本成人中文字幕在线视频| 午夜激情一区二区| 日韩一区精品字幕| 亚洲国产综合色| 午夜影院在线观看欧美| 麻豆一区二区三区| 国产在线不卡一区| 国产成人午夜精品影院观看视频 | 国产亚洲成aⅴ人片在线观看| 日韩精品一区二区在线| 精品少妇一区二区三区日产乱码 | 久久夜色精品一区| 国产欧美精品一区二区三区四区 | 日本欧美在线观看| 国产精品资源在线观看| 成人黄色在线视频| 日韩亚洲欧美综合| 欧美不卡一二三| 国产欧美精品国产国产专区| 国产精品网站一区| 亚洲品质自拍视频| 亚洲成人av中文| 久久精品国产网站| 国产在线视视频有精品| 成人做爰69片免费看网站| 99久久国产综合精品色伊| 色婷婷久久久久swag精品 | 国产一区 二区 三区一级| 成人国产一区二区三区精品| 色婷婷狠狠综合| 日韩欧美国产不卡| 国产精品短视频| 无码av免费一区二区三区试看| 激情文学综合丁香| 91在线观看美女| 欧美日韩国产综合一区二区三区 | 国产一区二区三区高清播放| 高清不卡一二三区| 99久久99久久精品免费观看| 成人免费av在线| 在线日韩av片| 精品国精品国产尤物美女| 中文字幕一区二区三区在线不卡 | 色综合久久六月婷婷中文字幕| 欧美丝袜丝交足nylons| 欧美电视剧在线观看完整版| 国产精品卡一卡二卡三| 欧美96一区二区免费视频| 波多野结衣一区二区三区| 欧美一区二区三区在| 亚洲柠檬福利资源导航| 激情图片小说一区| 欧美影院午夜播放| 国产女人18水真多18精品一级做| 一区二区三区四区中文字幕| 日本不卡不码高清免费观看| 国产精品99久久不卡二区| 色诱视频网站一区| 日韩西西人体444www| 国产精品电影院| 奇米一区二区三区av| 日本道色综合久久| 精品美女一区二区三区| 午夜亚洲国产au精品一区二区| 成人禁用看黄a在线| 精品久久久久久久人人人人传媒| 亚洲一线二线三线久久久| 成人午夜av影视| 26uuu欧美| 美女性感视频久久| 欧美色倩网站大全免费| 综合自拍亚洲综合图不卡区| 国产精品亚洲一区二区三区妖精 | 久久久久久久一区| 天涯成人国产亚洲精品一区av| 国产麻豆欧美日韩一区| 制服丝袜亚洲播放| 亚洲第一会所有码转帖| 日本精品一区二区三区高清| 国产精品久久久久久久久晋中| 精品在线视频一区| 日韩欧美一区中文| 日韩黄色在线观看| 欧美日韩电影在线播放| 亚洲狠狠爱一区二区三区| 色哟哟欧美精品| 综合欧美一区二区三区| 国产成人精品在线看| 久久婷婷国产综合国色天香| 另类小说综合欧美亚洲| 中文字幕在线播放不卡一区| 国产麻豆午夜三级精品| 精品国产三级电影在线观看| 麻豆精品在线看| 欧美精品免费视频| 亚洲国产欧美日韩另类综合| 国产精品66部| 欧美一级日韩一级| 国内成人免费视频| 国产免费观看久久| 波多野结衣的一区二区三区| 国产精品久久久久久久久免费桃花| 成人免费看黄yyy456| 国产精品久久99| 色偷偷一区二区三区| 亚洲综合小说图片| www.日韩在线| 亚洲免费观看高清完整| 色av综合在线| 亚洲成av人片一区二区梦乃| 91精品国产综合久久国产大片| 亚洲黄一区二区三区| 欧美三级日韩三级国产三级| 亚洲另类春色校园小说| 色综合久久久久综合| 一区二区不卡在线播放| 成人av在线播放网址| 亚洲精品高清在线| 制服丝袜在线91| 国产在线精品一区二区| 中文字幕欧美一| 欧美日韩激情在线| 国内精品国产成人国产三级粉色| 中文字幕的久久| 在线精品亚洲一区二区不卡| 日韩电影在线观看一区| 国产午夜精品在线观看| 91性感美女视频| 手机精品视频在线观看| 国产亚洲精品超碰| 欧美亚洲自拍偷拍| 国产美女久久久久| 亚洲欧美日韩国产综合在线| 制服丝袜在线91| 成人午夜电影网站| 亚洲aaa精品| 国产精品色一区二区三区| 欧美情侣在线播放| 成人国产精品免费| 免费看日韩精品| 亚洲人成在线播放网站岛国| 日韩欧美一级二级三级久久久|