Kafka.Client.ZooKeeperIntegration.Listeners.BrokerTopicsListener.BrokerTopicsListener C# (CSharp) Method

BrokerTopicsListener() public method

Initializes a new instance of the BrokerTopicsListener class.
public BrokerTopicsListener ( IZooKeeperClient zkclient, IDictionary actualBrokerTopicsPartitionsMap, Broker>.IDictionary actualBrokerIdMap, Action callback ) : System
zkclient IZooKeeperClient The wrapper on ZooKeeper client.
actualBrokerTopicsPartitionsMap IDictionary The actual broker topics partitions map.
actualBrokerIdMap Broker>.IDictionary The actual broker id map.
callback Action The callback invoked after new broker is added.
return System
        public BrokerTopicsListener(
            IZooKeeperClient zkclient,
            IDictionary<string, SortedSet<Partition>> actualBrokerTopicsPartitionsMap,
            IDictionary<int, Broker> actualBrokerIdMap,
            Action<int, string, int> callback)
        {
            this.zkclient = zkclient;
            this.actualBrokerTopicsPartitionsMap = actualBrokerTopicsPartitionsMap;
            this.actualBrokerIdMap = actualBrokerIdMap;
            this.callback = callback;
            this.oldBrokerIdMap = new Dictionary<int, Broker>(this.actualBrokerIdMap);
            this.oldBrokerTopicsPartitionsMap = new Dictionary<string, SortedSet<Partition>>(this.actualBrokerTopicsPartitionsMap);
            Logger.Debug("Creating broker topics listener to watch the following paths - \n"
                + "/broker/topics, /broker/topics/topic, /broker/ids");
            Logger.Debug("Initialized this broker topics listener with initial mapping of broker id to "
                + "partition id per topic with " + this.oldBrokerTopicsPartitionsMap.ToMultiString(
                    x => x.Key + " --> " + x.Value.ToMultiString(y => y.ToString(), ","), "; "));
        }