예제 #1
0
        public string GetString(long rowID, ReadContext readContext)
        {
            var symRowID = _data.ReadInt32(rowID * INT32_SIZE);

            if (symRowID == MetadataConstants.NULL_SYMBOL_VALUE)
            {
                return(null);
            }

#if DEBUG
            if (symRowID < 0)
            {
                throw new IndexOutOfRangeException(_data.Filename + "|" + PropertyName + "|" + rowID + "\n" +
                                                   ((CompositeRawFile)_data).GetAllUnsafePointers()
                                                   + "\n" + ((CompositeRawFile)_data).GetAllBufferPointers());
            }
#endif

            var    symbolCache = readContext.GetCache(_partitionID, _columnId, _capacity);
            string value;
            if (symbolCache.IsValueCached(symRowID, out value))
            {
                return(value);
            }

            value = _globalSymColumn.GetString(symRowID, readContext);
            symbolCache.SetRowID(value, symRowID);
            return(value);
        }
예제 #2
0
        public string GetKeyValue(int keyId, ReadContext tx)
        {
            var    symbolCache = tx.GetCache(_partitionID, _columnId, _cacheCapacity);
            string value;

            if (symbolCache.IsValueCached(keyId, out value))
            {
                return(value);
            }
            value = _globalSymColumn.GetString(keyId, tx);
            symbolCache.SetRowID(value, keyId);
            return(value);
        }