com.taobao.metamorphosis.client.consumer
类 ConsumerZooKeeper

java.lang.Object
  继承者 com.taobao.metamorphosis.client.consumer.ConsumerZooKeeper
所有已实现的接口:
ZkClientChangedListener
直接已知子类:
SlaveConsumerZooKeeper

public class ConsumerZooKeeper
extends Object
implements ZkClientChangedListener

Consumer与Zookeeper交互

作者:
boyan, wuhua

嵌套类摘要
 class ConsumerZooKeeper.ZKLoadRebalanceListener
          Consumer load balance listener for zookeeper.
 
字段摘要
protected  ConcurrentHashMap<FetchManager,FutureTask<ConsumerZooKeeper.ZKLoadRebalanceListener>> consumerLoadBalanceListeners
           
protected  MetaZookeeper metaZookeeper
           
protected  org.I0Itec.zkclient.ZkClient zkClient
           
 
构造方法摘要
ConsumerZooKeeper(MetaZookeeper metaZookeeper, RemotingClientWrapper remotingClient, org.I0Itec.zkclient.ZkClient zkClient, ZkUtils.ZKConfig zkConfig)
           
 
方法摘要
 void commitOffsets(FetchManager fetchManager)
           
 ConsumerZooKeeper.ZKLoadRebalanceListener getBrokerConnectionListener(FetchManager fetchManager)
           
protected  String getConsumerUUID(ConsumerConfig consumerConfig)
           
 void onZkClientChanged(org.I0Itec.zkclient.ZkClient newClient)
          当新的zkClient建立的时候
 void registerConsumer(ConsumerConfig consumerConfig, FetchManager fetchManager, ConcurrentHashMap<String,SubscriberInfo> topicSubcriberRegistry, OffsetStorage offsetStorage, LoadBalanceStrategy loadBalanceStrategy)
          注册订阅者
protected  ConsumerZooKeeper.ZKLoadRebalanceListener registerConsumerInternal(ConsumerZooKeeper.ZKLoadRebalanceListener loadBalanceListener)
           
 void unRegisterConsumer(FetchManager fetchManager)
          取消注册consumer
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

zkClient

protected org.I0Itec.zkclient.ZkClient zkClient

consumerLoadBalanceListeners

protected final ConcurrentHashMap<FetchManager,FutureTask<ConsumerZooKeeper.ZKLoadRebalanceListener>> consumerLoadBalanceListeners

metaZookeeper

protected final MetaZookeeper metaZookeeper
构造方法详细信息

ConsumerZooKeeper

public ConsumerZooKeeper(MetaZookeeper metaZookeeper,
                         RemotingClientWrapper remotingClient,
                         org.I0Itec.zkclient.ZkClient zkClient,
                         ZkUtils.ZKConfig zkConfig)
方法详细信息

commitOffsets

public void commitOffsets(FetchManager fetchManager)

getBrokerConnectionListener

public ConsumerZooKeeper.ZKLoadRebalanceListener getBrokerConnectionListener(FetchManager fetchManager)

unRegisterConsumer

public void unRegisterConsumer(FetchManager fetchManager)
取消注册consumer

参数:
fetchManager -

registerConsumer

public void registerConsumer(ConsumerConfig consumerConfig,
                             FetchManager fetchManager,
                             ConcurrentHashMap<String,SubscriberInfo> topicSubcriberRegistry,
                             OffsetStorage offsetStorage,
                             LoadBalanceStrategy loadBalanceStrategy)
                      throws Exception
注册订阅者

抛出:
Exception

registerConsumerInternal

protected ConsumerZooKeeper.ZKLoadRebalanceListener registerConsumerInternal(ConsumerZooKeeper.ZKLoadRebalanceListener loadBalanceListener)
                                                                      throws UnknownHostException,
                                                                             InterruptedException,
                                                                             Exception
抛出:
UnknownHostException
InterruptedException
Exception

getConsumerUUID

protected String getConsumerUUID(ConsumerConfig consumerConfig)
                          throws Exception
抛出:
Exception

onZkClientChanged

public void onZkClientChanged(org.I0Itec.zkclient.ZkClient newClient)
从接口 ZkClientChangedListener 复制的描述
当新的zkClient建立的时候

指定者:
接口 ZkClientChangedListener 中的 onZkClientChanged


Copyright © 2010–2013. All rights reserved.