Exemplo n.º 1
0
        public int GetDataSize()
        {
            int dataSize = 0;

            switch (this.Type)
            {
            case ColumnValueType.Integer:
                dataSize = 8;
                break;

            case ColumnValueType.String:

                dataSize = this.StringValue == null ? 0 : OtsUtils.CalcStringSizeInBytes(this.StringValue);
                break;

            case ColumnValueType.Binary:
                dataSize = this.BinaryValue.Length;
                break;

            case ColumnValueType.Double:
                dataSize = 8;
                break;

            case ColumnValueType.Boolean:
                dataSize = 1;
                break;

            default:
                throw new TypeLoadException("Bug: not support the type : " + this.Type);
            }

            return(dataSize);
        }
Exemplo n.º 2
0
        public int GetDataSize()
        {
            if (dataSize == -1)
            {
                dataSize = OtsUtils.CalcStringSizeInBytes(Name) + Value.GetDataSize();
            }

            return(dataSize);
        }
        public new int GetDataSize()
        {
            if (dataSize == -1)
            {
                int size = OtsUtils.CalcStringSizeInBytes(Name) + Value.GetDataSize();
                if (this.Timestamp.HasValue)
                {
                    size += 8;
                }

                dataSize = size;
            }

            return(dataSize);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取行主键的数据大小总和,大小总和包括所有主键列的名称和值。
        /// </summary>
        /// <returns>行主键的数据大小总和</returns>
        public int GetDataSize()
        {
            if (this.Keys == null)
            {
                return(0);
            }


            int size = 0;

            foreach (var key in this.Keys)
            {
                size += OtsUtils.CalcStringSizeInBytes(key);
                size += this[key].GetDataSize();
            }

            return(size);
        }