Ejemplo n.º 1
0
 private void Setup(PartitionedTopicMetadata p)
 {
     if (p.Partitions > 0)
     {
         for (var i = 0; i < p.Partitions; i++)
         {
             Context.ActorOf(PrestoTaggedSourceActor.Prop(_buffer, true, _message, _message.Tag));
         }
     }
     else
     {
         Context.ActorOf(PrestoTaggedSourceActor.Prop(_buffer, true, _message, _message.Tag));
     }
 }
Ejemplo n.º 2
0
 private void Setup(PartitionedTopicMetadata p, string topic)
 {
     if (p.Partitions > 0)
     {
         for (var i = 0; i < p.Partitions; i++)
         {
             var child = Context.ActorOf(PrestoSourceActor.Prop(_buffer, false, _message));
             Context.Watch(child);
         }
     }
     else
     {
         var child = Context.ActorOf(PrestoSourceActor.Prop(_buffer, false, _message));
         Context.Watch(child);
     }
 }
Ejemplo n.º 3
0
 private IList <string> GetPartitionsForTopic(TopicName topicName, PartitionedTopicMetadata metadata)
 {
     if (metadata.Partitions > 0)
     {
         IList <string> partitions = new List <string>(metadata.Partitions);
         for (var i = 0; i < metadata.Partitions; i++)
         {
             partitions.Add(topicName.GetPartition(i).ToString());
         }
         return(partitions);
     }
     else
     {
         return(new List <string> {
             topicName.ToString()
         });
     }
 }
Ejemplo n.º 4
0
 private void Setup(PartitionedTopicMetadata p, string topic)
 {
     if (p.Partitions > 0)
     {
         for (var i = 0; i < p.Partitions; i++)
         {
             var partitionTopic = TopicName.Get(topic).GetPartition(i);
             var partitionName  = partitionTopic.ToString();
             var msgId          = GetMessageId();
             var config         = PrepareConsumerConfiguration(_message.Configuration, partitionName, new MessageId(msgId.LedgerId, msgId.EntryId, i),
                                                               (int)(_message.ToMessageId - _message.FromMessageId));
             Context.ActorOf(PulsarTaggedSourceActor <T> .Prop(_message.ClientConfiguration, config, _client, _lookup, _cnxPool, _generator, _message.FromMessageId, _message.ToMessageId, true, _message.Tag, _schema));
         }
     }
     else
     {
         var msgId  = GetMessageId();
         var config = PrepareConsumerConfiguration(_message.Configuration, topic, msgId, (int)(_message.ToMessageId - _message.FromMessageId));
         Context.ActorOf(PulsarTaggedSourceActor <T> .Prop(_message.ClientConfiguration, config, _client, _lookup, _cnxPool, _generator, _message.FromMessageId, _message.ToMessageId, true, _message.Tag, _schema));
     }
 }