コード例 #1
0
ファイル: LianaTrie.cs プロジェクト: hhblaze/DBreeze
        public IEnumerable<LTrieRow> IterateBackwardSkip(ulong skippingQuantity, ITrieRootNode readRootNode)
        {
            this.CheckTableIsOperable();

            if (readRootNode==null)
            {
                //Flashing changes on the disk before commit. In case if the same thread uses the same root node
                this.SaveGenerationMap();

                Backward bw = new Backward(rn);
                return bw.IterateBackwardSkip(skippingQuantity,false);

            }
            else
            {
                Backward bw = new Backward((LTrieRootNode)readRootNode);
                return bw.IterateBackwardSkip(skippingQuantity,true);
            }
        }
コード例 #2
0
ファイル: LianaTrie.cs プロジェクト: hhblaze/DBreeze
        public IEnumerable<LTrieRow> IterateBackwardStartFrom(byte[] key, bool includeStartKey, ITrieRootNode readRootNode)
        {
            this.CheckTableIsOperable();

            if (readRootNode==null)
            {
                //Flashing changes on the disk before commit. In case if the same thread uses the same root node
                this.SaveGenerationMap();

                Backward bw = new Backward(rn);
                return bw.IterateBackwardStartFrom(key, includeStartKey,false);

            }
            else
            {
                Backward bw = new Backward((LTrieRootNode)readRootNode);
                return bw.IterateBackwardStartFrom(key, includeStartKey,true);
            }
        }
コード例 #3
0
ファイル: LianaTrie.cs プロジェクト: hhblaze/DBreeze
        public LTrieRow IterateBackwardForMaximal(ITrieRootNode readRootNode)
        {
            this.CheckTableIsOperable();

            if (readRootNode==null)
            {
                //Flashing changes on the disk before commit. In case if the same thread uses the same root node
                this.SaveGenerationMap();

                Backward bw = new Backward(rn);
                return bw.IterateBackwardForMaximal(false);

            }
            else
            {
                Backward bw = new Backward((LTrieRootNode)readRootNode);
                return bw.IterateBackwardForMaximal(true);
            }
        }
コード例 #4
0
ファイル: LianaTrie.cs プロジェクト: hhblaze/DBreeze
        /// <summary>
        /// DBreeze compatible.
        /// Extension, which helps to READ-THREADS smartly utilize created before read-roots
        /// </summary>
        /// <param name="key"></param>
        /// <param name="readRootNode">if null then WRITE-ROOT NODE</param>
        /// <returns></returns>
        public LTrieRow GetKey(ref byte[] key, ITrieRootNode readRootNode)
        {
            this.CheckTableIsOperable();

            if (readRootNode==null)
            {
                //Flashing changes on the disk before commit. In case if the same thread uses the same root node
                this.SaveGenerationMap();

                return rn.GetKey(key,false);

            }
            else
            {
                return ((LTrieRootNode)readRootNode).GetKey(key,true);
            }
        }
コード例 #5
0
ファイル: LianaTrie.cs プロジェクト: hhblaze/DBreeze
        /// <summary>
        /// Can be used inside of DBreeze - concerns all read functions
        /// </summary>
        /// <param name="SYNCHRO_READ"></param>
        /// <returns></returns>
        public ulong Count(ITrieRootNode readRootNode)
        {
            this.CheckTableIsOperable();

            if (readRootNode==null)
            {
                //Flashing changes on the disk before commit. In case if the same thread uses the same root node
                this.SaveGenerationMap();

                return rn.RecordsCount;

            }
            else
            {
                //LTrieRootNode readRootNode = new LTrieRootNode(this);
                return ((LTrieRootNode)readRootNode).RecordsCount;
            }
        }
コード例 #6
0
ファイル: LianaTrie.cs プロジェクト: hhblaze/DBreeze
        /// <summary>
        /// 
        /// </summary>
        /// <param name="startKey"></param>
        /// <param name="readRootNode"></param>
        /// <returns></returns>
        public IEnumerable<LTrieRow> IterateForwardStartsWithClosestToPrefix(byte[] startKey, ITrieRootNode readRootNode)
        {
            this.CheckTableIsOperable();

            if (readRootNode == null)
            {
                //Flashing changes on the disk before commit. In case if the same thread uses the same root node
                this.SaveGenerationMap();

                Forward bw = new Forward(rn);
                return bw.IterateForwardStartsWithClosestToPrefix(startKey, false);

            }
            else
            {
                Forward bw = new Forward((LTrieRootNode)readRootNode);
                return bw.IterateForwardStartsWithClosestToPrefix(startKey, true);
            }
        }
コード例 #7
0
ファイル: LianaTrie.cs プロジェクト: hhblaze/DBreeze
        //bool SYNCHRO_READ
        public IEnumerable<LTrieRow> IterateForward(ITrieRootNode readRootNode)
        {
            this.CheckTableIsOperable();

            if (readRootNode == null)   //SYNCHRO_READ
            {
                //Flashing changes on the disk before commit. In case if the same thread uses the same root node
                this.SaveGenerationMap();

                Forward fw = new Forward(rn);
                return fw.IterateForward(false);

            }
            else
            {
                Forward fw = new Forward((LTrieRootNode)readRootNode);
                return fw.IterateForward(true);
            }
        }