com.taobao.metamorphosis.client.consumer
类 FetchRequest

java.lang.Object
  继承者 com.taobao.metamorphosis.client.consumer.FetchRequest
所有已实现的接口:
Comparable<Delayed>, Delayed

public class FetchRequest
extends Object
implements Delayed

一次获取请求

作者:
boyan

构造方法摘要
FetchRequest(Broker broker, long delay, TopicPartitionRegInfo topicPartitionRegInfo, int maxSize)
           
 
方法摘要
 int compareTo(Delayed o)
           
 void decreaseMaxSize()
           
 boolean equals(Object obj)
           
 Broker getBroker()
           
 long getDelay()
           
 long getDelay(TimeUnit unit)
           
 long getLastMessageId()
           
 int getMaxSize()
           
 long getOffset()
          返回将要使用的offset,如果有临时offset,则优先使用临时offset
 int getPartition()
           
 Partition getPartitionObject()
           
 com.taobao.metamorphosis.client.consumer.FetchRequestQueue getRefQueue()
           
 int getRetries()
           
 String getTopic()
           
 TopicPartitionRegInfo getTopicPartitionRegInfo()
           
 int hashCode()
           
 void increaseMaxSize()
           
 int incrementRetriesAndGet()
           
 void resetRetries()
           
 void rollbackOffset()
           
 void setBroker(Broker broker)
           
 void setDelay(long delay)
          设置延后的时间,单位毫秒
 void setOffset(long offset, long msgId, boolean ack)
          更新offset,当ack为true则更新存储中的offset,并将临时offset设置为-1,否则仅更新临时offset
 void setRefQueue(com.taobao.metamorphosis.client.consumer.FetchRequestQueue refQueue)
           
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

FetchRequest

public FetchRequest(Broker broker,
                    long delay,
                    TopicPartitionRegInfo topicPartitionRegInfo,
                    int maxSize)
方法详细信息

getTopicPartitionRegInfo

public TopicPartitionRegInfo getTopicPartitionRegInfo()

getRefQueue

public com.taobao.metamorphosis.client.consumer.FetchRequestQueue getRefQueue()

setRefQueue

public void setRefQueue(com.taobao.metamorphosis.client.consumer.FetchRequestQueue refQueue)

getRetries

public int getRetries()

increaseMaxSize

public void increaseMaxSize()

decreaseMaxSize

public void decreaseMaxSize()

resetRetries

public void resetRetries()

incrementRetriesAndGet

public int incrementRetriesAndGet()

hashCode

public int hashCode()
覆盖:
Object 中的 hashCode

equals

public boolean equals(Object obj)
覆盖:
Object 中的 equals

getBroker

public Broker getBroker()

setBroker

public void setBroker(Broker broker)

setDelay

public void setDelay(long delay)
设置延后的时间,单位毫秒

参数:
delay -

compareTo

public int compareTo(Delayed o)
指定者:
接口 Comparable<Delayed> 中的 compareTo

getDelay

public long getDelay()

getDelay

public long getDelay(TimeUnit unit)
指定者:
接口 Delayed 中的 getDelay

getMaxSize

public int getMaxSize()

setOffset

public void setOffset(long offset,
                      long msgId,
                      boolean ack)
更新offset,当ack为true则更新存储中的offset,并将临时offset设置为-1,否则仅更新临时offset

参数:
offset -
ack -

getTopic

public String getTopic()

getPartition

public int getPartition()

getPartitionObject

public Partition getPartitionObject()

rollbackOffset

public void rollbackOffset()

getLastMessageId

public long getLastMessageId()

getOffset

public long getOffset()
返回将要使用的offset,如果有临时offset,则优先使用临时offset

返回:


Copyright © 2010–2013. All rights reserved.