private void CreateFetcher() { if (this.EnableFetcher) { this.fetcher = new ConsumerFetcherManager(consumerIdString, this.Config, zkClient); } }
public FetcherTest() { this.cluster = new Cluster(Configs.Select(c => new Broker(c.BrokerId, "localhost", c.Port))); this.topicInfos = this.Configs.Select( c => new PartitionTopicInfo( this.topic, 0, this.queue, new AtomicLong(0), new AtomicLong(0), new AtomicInteger(0), string.Empty)) .ToList(); AdminUtils.CreateOrUpdateTopicPartitionAssignmentPathInZK( this.ZkClient, this.topic, new Dictionary<int, List<int>> { { 0, new List<int> { Configs.First().BrokerId } } }, new Dictionary<string, string>()); TestUtils.WaitUntilLeaderIsElectedOrChanged(this.ZkClient, this.topic, 0, 500); this.fetcher = new ConsumerFetcherManager("consumer1", new ConsumerConfig(string.Empty, 1234, string.Empty), ZkClient); this.fetcher.StopConnections(); this.fetcher.StartConnections(this.topicInfos, this.cluster); }
public ConsumerFetcherThread( string name, ConsumerConfig config, Broker sourceBroker, IDictionary<TopicAndPartition, PartitionTopicInfo> partitionMap, ConsumerFetcherManager consumerFetcherManager) : base( name, config.ClientId + "-" + name, sourceBroker, config.SocketTimeoutMs, config.SocketReceiveBufferBytes, config.FetchMessageMaxBytes, Request.OrdinaryConsumerId, config.FetchWaitMaxMs, config.FetchMinBytes, true) { this.partitionMap = partitionMap; this.config = config; this.consumerFetcherManager = consumerFetcherManager; }
public ConsumerFetcherThread( string name, ConsumerConfig config, Broker sourceBroker, IDictionary <TopicAndPartition, PartitionTopicInfo> partitionMap, ConsumerFetcherManager consumerFetcherManager) : base( name, config.ClientId + "-" + name, sourceBroker, config.SocketTimeoutMs, config.SocketReceiveBufferBytes, config.FetchMessageMaxBytes, Request.OrdinaryConsumerId, config.FetchWaitMaxMs, config.FetchMinBytes, true) { this.partitionMap = partitionMap; this.config = config; this.consumerFetcherManager = consumerFetcherManager; }
public LeaderFinderThread(ConsumerFetcherManager parent, string name) : base(name) { this.parent = parent; }