System.Collections.Concurrent.BlockingCollection.Add(FetchedDataChunk)

Here are the examples of the csharp api class System.Collections.Concurrent.BlockingCollection.Add(FetchedDataChunk) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

5 Examples 7

1. Example

Project: kafka-net
Source File: PartitionTopicInfo.cs
public void Enqueue(ByteBufferMessageSet messages)
        {
            var size = messages.ValidBytes;
            if (size > 0)
            {
                var next = messages.ShallowIterator().ToEnumerable().Last().NextOffset;
                Logger.DebugFormat("Updating fetch offset = {0} to {1}", this.fetchedOffset.Get(), next);
                this.chunkQueue.Add(new FetchedDataChunk(messages, this, this.fetchedOffset.Get()));
                this.fetchedOffset.Set(next);
                Logger.DebugFormat("Updated fetch offset of {0} to {1}", this, next);
                this.consumerTopicStats.GetConsumerTopicStats(this.Topic).ByteRate.Mark(size);
                this.consumerTopicStats.GetConsumerAllTopicStats().ByteRate.Mark(size);
            }
            else if (messages.SizeInBytes > 0)
            {
                this.chunkQueue.Add(new FetchedDataChunk(messages, this, this.fetchedOffset.Get()));
            }
        }

2. Example

Project: IFramework
Source File: PartitionTopicInfo.cs
public int Add(BufferedMessageSet messages)
        {
            var size = messages.SetSize;
            if (size > 0)
            {
                var offset = messages.Messages.Last().Offset;

                Logger.InfoFormat("{2} : Updating fetch offset = {0} with value = {1}", fetchedOffset, offset,
                                  PartitionId);
                chunkQueue.Add(new FetchedDataChunk(messages, this, fetchedOffset));
                Interlocked.Exchange(ref fetchedOffset, offset);
                Logger.Debug("Updated fetch offset of " + this + " to " + offset);
            }

            return size;
        }

3. Example

Project: IFramework
Source File: ZookeeperConsumerConnector.cs
private void SendShutdownToAllQueues()
        {
            foreach (var queue in queues)
            {
                Logger.InfoFormat("Clearing up queue");
                // clear the queue
                while (queue.Value.Count > 0)
                {
                    FetchedDataChunk item = null;
                    queue.Value.TryTake(out item);
                }

                queue.Value.Add(ShutdownCommand);
                Logger.InfoFormat("Cleared queue and sent shutdown command");
            }
        }

4. Example

Project: IFramework
Source File: ConsumerIterator.cs
private TData MakeNext()
        {
            if (current == null || !current.MoveNext())
         /n ..... /n //View Source file for more details /n }

5. Example

Project: kafka-net
Source File: ConsumerIterator.cs
protected override MessageAndMetadata<TKey, TValue> MakeNext()
        {
            FetchedDa/n ..... /n //View Source file for more details /n }