Esempio n. 1
0
 public NodeAVLDisk(RowAVLDisk r, IRowInputInterface input, int id)
 {
     this._iLeft   = -1;
     this._iParent = -1;
     this._iRight  = -1;
     this.row      = r;
     this._iId     = id;
     this.iData    = r.GetPos();
     base.IBalance = input.ReadInt();
     this._iLeft   = input.ReadInt();
     if (this._iLeft <= 0)
     {
         this._iLeft = -1;
     }
     this._iRight = input.ReadInt();
     if (this._iRight <= 0)
     {
         this._iRight = -1;
     }
     this._iParent = input.ReadInt();
     if (this._iParent <= 0)
     {
         this._iParent = -1;
     }
 }
Esempio n. 2
0
        private ICachedObject GetFromFile(int pos, IPersistentStore store, bool keep)
        {
            ICachedObject obj2;

            Monitor.Enter(this.Lock);
            try
            {
                ICachedObject row = this.cache.Get(pos);
                if (row != null)
                {
                    if (keep)
                    {
                        row.KeepInMemory(true);
                    }
                    return(row);
                }
                for (int i = 0; i < 2; i++)
                {
                    try
                    {
                        IRowInputInterface interface2 = this.ReadObject(pos);
                        if (interface2 == null)
                        {
                            return(null);
                        }
                        row = store.Get(interface2);
                        break;
                    }
                    catch (OutOfMemoryException)
                    {
                        this.cache.ForceCleanUp();
                        if (i > 0)
                        {
                            throw;
                        }
                    }
                }
                pos = row.GetPos();
                this.cache.Put(pos, row);
                if (keep)
                {
                    row.KeepInMemory(true);
                }
                store.Set(row);
                obj2 = row;
            }
            catch (CoreException exception)
            {
                this.database.logger.LogSevereEvent(this.DataFileName + FwNs.Core.LC.cResources.SR.DataFileCache_GetFromFile__getFromFile_ + pos, exception);
                throw;
            }
            finally
            {
                Monitor.Exit(this.Lock);
            }
            return(obj2);
        }
Esempio n. 3
0
 protected virtual void InitBuffers()
 {
     if ((this.RowOut == null) || (this.RowOut.GetOutputStream().GetBuffer().Length > 0x100))
     {
         this.RowOut = new RowOutputBinaryEncode(this.database.logger.GetCrypto(), 0x100, this.CachedRowPadding);
     }
     if ((this.RowIn == null) || (this.RowIn.GetBuffer().Length > 0x100))
     {
         this.RowIn = new RowInputBinaryDecode(this.database.logger.GetCrypto(), new byte[0x100]);
     }
 }
Esempio n. 4
0
        public void Read(IRowInputInterface i, ResultMetaData meta)
        {
            base.Id = i.ReadLong();
            int num = i.ReadInt();

            i.ReadInt();
            i.ReadInt();
            while (num-- > 0)
            {
                this.Add(i.ReadData(meta.ColumnTypes));
            }
        }
Esempio n. 5
0
        public override ICachedObject Get(IRowInputInterface input)
        {
            ICachedObject obj2;

            try
            {
                obj2 = new RowAVLDisk(base.table, input);
            }
            catch (IOException exception)
            {
                throw Error.GetError(0x1d2, exception);
            }
            return(obj2);
        }
Esempio n. 6
0
        public RowAVLDisk(TableBase t, IRowInputInterface _in) : base(t, null)
        {
            base.Position    = _in.GetPos();
            this.storageSize = _in.GetSize();
            int indexCount = t.GetIndexCount();

            base.NPrimaryNode = new NodeAVLDisk(this, _in, 0);
            NodeAVL nPrimaryNode = base.NPrimaryNode;

            for (int i = 1; i < indexCount; i++)
            {
                nPrimaryNode.nNext = new NodeAVLDisk(this, _in, i);
                nPrimaryNode       = nPrimaryNode.nNext;
            }
            base.RowData = _in.ReadData(base.table.GetColumnTypes());
        }
Esempio n. 7
0
 public override ICachedObject Get(IRowInputInterface input)
 {
     try
     {
         if (this._isCached)
         {
             return(new RowAVLDisk(base.table, input));
         }
     }
     catch (CoreException)
     {
         return(null);
     }
     catch (IOException)
     {
         return(null);
     }
     return(null);
 }
Esempio n. 8
0
 public virtual void ReadSimple(IRowInputInterface i, ResultMetaData meta)
 {
     throw Error.RuntimeError(0xc9, "RowSetNavigator");
 }
Esempio n. 9
0
 public abstract ICachedObject Get(IRowInputInterface i);
Esempio n. 10
0
 public override ICachedObject Get(IRowInputInterface input)
 {
     return(null);
 }