|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectnet.neoremind.fountain.common.mq.AbstractMaxCapacityFountainMQ
public abstract class AbstractMaxCapacityFountainMQ
内存队列实现的抽象类. 使用无界BlockingQueue保存消息,使用guardLimit控制消息数量
| 字段摘要 | |
|---|---|
protected int |
limitSize
队列容量上限 |
| 构造方法摘要 | |
|---|---|
protected |
AbstractMaxCapacityFountainMQ(int limit)
构造方法 |
| 方法摘要 | |
|---|---|
protected abstract int |
getRequiredPermits(BinlogTraceable e)
从一个数据消息中获取需要权限的个数 |
BinlogTraceable |
pop()
从队列中读取一个消息,如果队列中没有消息,则堵塞直到有一个消息进入 |
BinlogTraceable |
pop(long timeout)
从队列中读取一个消息,支持超时版本,如果队列中没有消息,则堵塞直到有一个消息进入 或者超时,超时时返回false |
void |
push(BinlogTraceable e)
push一个消息,对于有界mq,如果容量已满,此方法会堵塞直到容量被至少是否一个unit |
boolean |
push(BinlogTraceable e,
long timeout)
push 一个消息,支持超时的版本,如果容量已满,此方法会堵塞直到容量被至少是否一个unit 或者超时,超时时返回false |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 从接口 net.neoremind.fountain.common.mq.FountainMQ 继承的方法 |
|---|
isExceedMaxCapacity |
| 字段详细信息 |
|---|
protected final int limitSize
| 构造方法详细信息 |
|---|
protected AbstractMaxCapacityFountainMQ(int limit)
limit - 队列容量的上限| 方法详细信息 |
|---|
protected abstract int getRequiredPermits(BinlogTraceable e)
e - 消息
public void push(BinlogTraceable e)
FountainMQ 复制的描述
FountainMQ 中的 pushe - 需要加入队列的元素
public boolean push(BinlogTraceable e,
long timeout)
FountainMQ 复制的描述
FountainMQ 中的 pushe - 需要加入队列的元素timeout - 单位ms
public BinlogTraceable pop()
FountainMQ 复制的描述
FountainMQ 中的 poppublic BinlogTraceable pop(long timeout)
FountainMQ 复制的描述
FountainMQ 中的 poptimeout - 单位ms
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||