Exemplo n.º 1
0
 public StringDictionaryBuilder Clear()
 {
     Entries.Clear();
     IndicesBuffer.Clear();
     NullBitmap.Clear();
     NextIndex = 0;
     return(this);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Get a specific null bitmap value
 /// </summary>
 public bool NullBitmapValue(short index)
 {
     if (false) // TODO: has sparse column...
     {
         return(false);
     }
     else
     {
         return(NullBitmap.Get(index - (HasUniqueifier ? 0 : 1)));
     }
 }
Exemplo n.º 3
0
 public bool NullBitmapValue(Column column)
 {
     if (column.NullBit < 1)
     {
         return(false);
     }
     else
     {
         return(NullBitmap.Get(column.NullBit - 1));
     }
 }
Exemplo n.º 4
0
            /// <inheritdoc />
            public StringDictionaryBuilder Append(string value)
            {
                if (value == null)
                {
                    NullBitmap.Append(0);
                    IndicesBuffer.Append(-1); // need something in the indices buffer to make sure it makes sense
                    NullCount++;
                    return(this);
                }


                var temp = new DictionaryEntry(value, Comparer, HashFunction);

                if (!Entries.TryGetValue(temp, out var index))
                {
                    index = NextIndex++;
                    Entries.Add(temp, index);
                    AppendStringToBuffer(value);
                }

                NullBitmap.Append(1);
                IndicesBuffer.Append(index);
                return(this);
            }
Exemplo n.º 5
0
 internal NullBitmap Clone()
 {
     NullBitmap newBitmap = new NullBitmap();
     newBitmap._nullBitmap = _nullBitmap == null ? null : (byte[])_nullBitmap.Clone();
     newBitmap._columnsCount = _columnsCount;
     return newBitmap;
 }
Exemplo n.º 6
0
 internal bool ReferenceEquals(NullBitmap obj)
 {
     return object.ReferenceEquals(_nullBitmap, obj._nullBitmap);
 }
Exemplo n.º 7
0
            internal void Snap()
            {
                _snapshotInBuffs.Clear();
                _snapshotInBuffCurrent = 0;
                _snapshotInBytesUsed = _stateObj._inBytesUsed;
                _snapshotInBytesPacket = _stateObj._inBytesPacket;
                _snapshotPendingData = _stateObj._pendingData;
                _snapshotErrorTokenReceived = _stateObj._errorTokenReceived;
                _snapshotMessageStatus = _stateObj._messageStatus;
                // _nullBitmapInfo must be cloned before it is updated
                _snapshotNullBitmapInfo = _stateObj._nullBitmapInfo;
                _snapshotLongLen = _stateObj._longlen;
                _snapshotLongLenLeft = _stateObj._longlenleft;
                _snapshotCleanupMetaData = _stateObj._cleanupMetaData;
                // _cleanupAltMetaDataSetArray must be cloned bofore it is updated
                _snapshotCleanupAltMetaDataSetArray = _stateObj._cleanupAltMetaDataSetArray;
                _snapshotHasOpenResult = _stateObj._hasOpenResult;
                _snapshotReceivedColumnMetadata = _stateObj._receivedColMetaData;
                _snapshotAttentionReceived = _stateObj._attentionReceived;
#if DEBUG
                _rollingPend = 0;
                _rollingPendCount = 0;
                _stateObj._lastStack = null;
                Debug.Assert(_stateObj._bTmpRead == 0, "Has partially read data when snapshot taken");
                Debug.Assert(_stateObj._partialHeaderBytesRead == 0, "Has partially read header when shapshot taken");
#endif

                PushBuffer(_stateObj._inBuff, _stateObj._inBytesRead);
            }
Exemplo n.º 8
0
 public StringDictionaryArray Build(MemoryAllocator allocator)
 {
     ValueOffsets.Append(Offset);
     return(new StringDictionaryArray(IndicesBuffer.Length, Entries.Count, NullBitmap.Build(allocator), IndicesBuffer.Build(allocator),
                                      ValueBuffer.Build(allocator), ValueOffsets.Build(allocator), NullCount));
 }