net.neoremind.fountain.common.mq
类 MultiPermitsMemFountainMQ
java.lang.Object
net.neoremind.fountain.common.mq.AbstractMaxCapacityFountainMQ
net.neoremind.fountain.common.mq.MultiPermitsMemFountainMQ
- 所有已实现的接口:
- FountainMQ
public class MultiPermitsMemFountainMQ
- extends AbstractMaxCapacityFountainMQ
- implements FountainMQ
每个数据消息占用多个队列容量的队列。如果队列剩余容量不够,则一直等到或者超时
当多个producer数据发往同一个mq时不要使用本实现,因为其他producer可能一直发送小事务,mq1内容容量
一直不能被释放出来,那么一个producer的大事务可能永远不能被处理
- 作者:
- hexiufeng
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultiPermitsMemFountainMQ
public MultiPermitsMemFountainMQ(int limit)
- 构造方法
- 参数:
limit - 容量上限
isExceedMaxCapacity
public boolean isExceedMaxCapacity(int len)
- 从接口
FountainMQ 复制的描述
- 是否超过队列的最大容量
- 指定者:
- 接口
FountainMQ 中的 isExceedMaxCapacity
- 参数:
len - 长度
- 返回:
- 是否超出
getRequiredPermits
protected int getRequiredPermits(BinlogTraceable e)
- 从类
AbstractMaxCapacityFountainMQ 复制的描述
- 从一个数据消息中获取需要权限的个数
- 指定者:
- 类
AbstractMaxCapacityFountainMQ 中的 getRequiredPermits
- 参数:
e - 消息
- 返回:
- 权限个数
Copyright © 2016 neoremind. All rights reserved.