接口 com.taobao.metamorphosis.client.producer.PartitionSelector
的使用

使用 PartitionSelector 的软件包
com.taobao.metamorphosis.client   
com.taobao.metamorphosis.client.extension   
com.taobao.metamorphosis.client.extension.producer   
com.taobao.metamorphosis.client.producer   
 

com.taobao.metamorphosis.clientPartitionSelector 的使用
 

参数类型为 PartitionSelectorcom.taobao.metamorphosis.client 中的方法
 MessageProducer MetaMessageSessionFactory.createProducer(PartitionSelector partitionSelector)
           
 MessageProducer MessageSessionFactory.createProducer(PartitionSelector partitionSelector)
          创建消息生产者
 MessageProducer MetaMessageSessionFactory.createProducer(PartitionSelector partitionSelector, boolean ordered)
          已过时。 
 MessageProducer MessageSessionFactory.createProducer(PartitionSelector partitionSelector, boolean ordered)
          已过时。 
 XAMessageProducer XAMetaMessageSessionFactory.createXAProducer(PartitionSelector partitionSelector)
           
 XAMessageProducer XAMessageSessionFactory.createXAProducer(PartitionSelector partitionSelector)
          创建XA消息生产者
 

com.taobao.metamorphosis.client.extensionPartitionSelector 的使用
 

参数类型为 PartitionSelectorcom.taobao.metamorphosis.client.extension 中的方法
 AsyncMessageProducer AsyncMetaMessageSessionFactory.createAsyncProducer(PartitionSelector partitionSelector)
           
 AsyncMessageProducer AsyncMessageSessionFactory.createAsyncProducer(PartitionSelector partitionSelector)
          创建异步单向的消息生产者
 AsyncMessageProducer AsyncMetaMessageSessionFactory.createAsyncProducer(PartitionSelector partitionSelector, AsyncMessageProducer.IgnoreMessageProcessor processor)
           
 AsyncMessageProducer AsyncMessageSessionFactory.createAsyncProducer(PartitionSelector partitionSelector, AsyncMessageProducer.IgnoreMessageProcessor processor)
          创建异步单向的消息生产者
 AsyncMessageProducer AsyncMetaMessageSessionFactory.createAsyncProducer(PartitionSelector partitionSelector, int slidingWindowSize)
           
 AsyncMessageProducer AsyncMessageSessionFactory.createAsyncProducer(PartitionSelector partitionSelector, int slidingWindowSize)
          创建异步单向的消息生产者
 MessageProducer OrderedMetaMessageSessionFactory.createProducer(PartitionSelector partitionSelector)
          创建消息生产者
 MessageProducer OrderedMetaMessageSessionFactory.createProducer(PartitionSelector partitionSelector, boolean ordered)
          创建消息生产者
 

com.taobao.metamorphosis.client.extension.producerPartitionSelector 的使用
 

实现 PartitionSelectorcom.taobao.metamorphosis.client.extension.producer 中的类
 class ConfigPartitionsSupport
          支持获取某topic分区总数的Selector
 class OrderedMessagePartitionSelector
           支持获取某topic分区总数,当前可用分区数跟配置分区不对应时 将抛出一个特殊的异常 AvailablePartitionNumException, 以便发送消息时可识别这个失败原因,从而做相应处理.
 

参数类型为 PartitionSelectorcom.taobao.metamorphosis.client.extension.producer 中的构造方法
AsyncMetaMessageProducer(MetaMessageSessionFactory messageSessionFactory, RemotingClientWrapper remotingClient, PartitionSelector partitionSelector, ProducerZooKeeper producerZooKeeper, String sessionId, int slidingWindowSize0, AsyncMessageProducer.IgnoreMessageProcessor processor)
           
OrderedMessageProducer(MetaMessageSessionFactory messageSessionFactory, RemotingClientWrapper remotingClient, PartitionSelector partitionSelector, ProducerZooKeeper producerZooKeeper, String sessionId, MessageRecoverManager localMessageStorageManager)
           
 

com.taobao.metamorphosis.client.producerPartitionSelector 的使用
 

实现 PartitionSelectorcom.taobao.metamorphosis.client.producer 中的类
 class AbstractPartitionSelector
          Abstract partition selector.
 class RandomPartitionSelector
          Random partition selector
 class RoundRobinPartitionSelector
          轮询的分区选择器,默认使用此选择器
 

声明为 PartitionSelectorcom.taobao.metamorphosis.client.producer 中的字段
protected  PartitionSelector SimpleMessageProducer.partitionSelector
           
 

返回 PartitionSelectorcom.taobao.metamorphosis.client.producer 中的方法
 PartitionSelector SimpleMessageProducer.getPartitionSelector()
           
 PartitionSelector MessageProducer.getPartitionSelector()
          返回本生产者的分区选择器
 

参数类型为 PartitionSelectorcom.taobao.metamorphosis.client.producer 中的方法
 Partition ProducerZooKeeper.selectPartition(String topic, Message message, PartitionSelector partitionSelector)
          根据topic和message选择分区
 

参数类型为 PartitionSelectorcom.taobao.metamorphosis.client.producer 中的构造方法
SimpleMessageProducer(MetaMessageSessionFactory messageSessionFactory, RemotingClientWrapper remotingClient, PartitionSelector partitionSelector, ProducerZooKeeper producerZooKeeper, String sessionId)
           
SimpleXAMessageProducer(MetaMessageSessionFactory messageSessionFactory, RemotingClientWrapper remotingClient, PartitionSelector partitionSelector, ProducerZooKeeper producerZooKeeper, String sessionId)
           
 



Copyright © 2010–2013. All rights reserved.