Atitit.提升软件稳定性---基于数据库实现的持久化 循环队列 环形队列
2014-08-05 19:47
190 查看
Atitit.提升软件稳定性---基于数据库实现的持久化 循环队列 环形队列
1. 前言::选型(马)
1
2. 实现java.util.queue接口 1
3. 当前指针的2个实现方式 1
1.1. 用一个游标last 来指示 (指针表字段last ),麻烦的,不推荐
1
1.2. (简单,推荐)使用循环次数来指示,每循环加1 (字段cirTimes),order by cirtimes
1
4. 表格设计id, cirTimes,createtime,handlerID,recID,delFlag 1
5. 循环队列 环形队列使用流程 2
1.3. 加入队列addALL,add 2
1.4. 抓取要处理的元素 peek(int fetchCount) delFlag=0,order by cirtimes 2
1.5. 出队并追加到队尾remove,removeALL(list)::: cirtimes++; 2
为甚要使用循环队列 ,,可以大的提升队列的稳定性..防止推送消息outdate不送...and避免队列卡住
转载请注明来源: http://blog.csdn.net/attilax
handlerID::可以让许多的处理器使用,每个processor只获得自己的队列..
recid::关联的rec id...
// attilax 老哇的爪子 m_9_r o7s
final List li=new ArrayList();
// noticeFlag is null
String hql="from GvDownloadTask where 1=1 and downloadStatus is null order by noticeFlag ";
Query q = getSession().createQuery(hql);
q.setFirstResult(0);
q.setMaxResults(fetchCount);
List l = q.list();
return l;
}
c.merge(t);
1. 前言::选型(马)
1
2. 实现java.util.queue接口 1
3. 当前指针的2个实现方式 1
1.1. 用一个游标last 来指示 (指针表字段last ),麻烦的,不推荐
1
1.2. (简单,推荐)使用循环次数来指示,每循环加1 (字段cirTimes),order by cirtimes
1
4. 表格设计id, cirTimes,createtime,handlerID,recID,delFlag 1
5. 循环队列 环形队列使用流程 2
1.3. 加入队列addALL,add 2
1.4. 抓取要处理的元素 peek(int fetchCount) delFlag=0,order by cirtimes 2
1.5. 出队并追加到队尾remove,removeALL(list)::: cirtimes++; 2
1. 前言::选型(马)
挑选李一瓦,马个适合的implet为甚要使用循环队列 ,,可以大的提升队列的稳定性..防止推送消息outdate不送...and避免队列卡住
2. 实现java.util.queue接口
3. 当前指针的2个实现方式
1.1. 用一个游标last 来指示 (指针表字段last ),麻烦的,不推荐
1.2. (简单,推荐)使用循环次数来指示,每循环加1 (字段cirTimes),order by cirtimes
作者::老哇的爪子Attilax艾龙,EMAIL:1466519819@qq.com转载请注明来源: http://blog.csdn.net/attilax
4. 表格设计id, cirTimes,createtime,handlerID,recID,delFlag
id, cirTimes,createtime,handlerID,recID,delFlaghandlerID::可以让许多的处理器使用,每个processor只获得自己的队列..
recid::关联的rec id...
5. 循环队列 环形队列使用流程
1.3. 加入队列addALL,add
1.4. 抓取要处理的元素 peek(int fetchCount) delFlag=0,order by cirtimes
public List peek(int fetchCount) {// attilax 老哇的爪子 m_9_r o7s
final List li=new ArrayList();
// noticeFlag is null
String hql="from GvDownloadTask where 1=1 and downloadStatus is null order by noticeFlag ";
Query q = getSession().createQuery(hql);
q.setFirstResult(0);
q.setMaxResults(fetchCount);
List l = q.list();
return l;
}
1.5. 出队并追加到队尾remove,removeALL(list)::: cirtimes++;
t.setNoticeFlag(t.getNoticeFlag()+1);c.merge(t);
相关文章推荐
- Atitit.提升软件稳定性---基于数据库实现的持久化 循环队列 环形队列
- Atitit.升级软件的稳定性---基于数据库实现持久化 循环队列 循环队列
- atitit.提升稳定性---hibernate 添加重试retry 机制解决数据库连接关闭
- Atitit. 提升软件开发效率and 开发质量---java 实现dsl 4gl 的本质and 精髓 O725
- Atitit.hybrid混合型应用 浏览器插件,控件的实现方式 浏览器运行本地程序的解决方案大的总结---提升用户体验and开发效率..
- 基于Berkeley DB实现的持久化队列
- Python 使用循环数组实现队列 (基于class, 包含迭代器)
- atitit.提升软件开发的效率and 质量的那些强大概念and方法总结
- 基于Berkeley DB实现的持久化队列
- php基于双向循环队列实现历史记录的前进后退等功能
- atitit.提升开发效率---mda 软件开发方式的革命
- 无锁编程[2]__一读一写无锁队列,其实就是循环队列,一写多读(基于计数器和更新开关),基于CAS实现:多读多写无锁循环队列
- atitit.提升软件开发效率大的总结O5
- atitit.提升开发效率---mda 软件开发方式的革命
- atitit.提升软件开发的生产力关健点-------大型开发工具最关健
- 基于数组的循环队列(C++模板实现)
- atitit.提升开发效率---MDA 软件开发方式的革命(3)----自动化建表
- atitit.提升软件开发的效率and 质量的那些强大概念and方法总结
- Atitit.软件按钮与仪表盘(13)--全文索引操作--db数据库子系统mssql2008
- atitit.提升软件开发的生产力关健点-------大型开发工具最关健