Atitit.升级软件的稳定性---基于数据库实现持久化 循环队列 循环队列
2015-07-12 21:17
543 查看
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);
相关文章推荐
- mysql意向锁的概念和用途
- mysql拒绝远程访问
- Sql sever 分组排序
- MySQL系列之F-3------MySQL恢复
- 使用NFS安装oracle软件
- MySQL系列之F-2------mysqldump -help
- MySQL系列之F------MySQL备份
- 一键安装ORACLE并建库脚本
- Oracle 数据迁移(从Oracle11G迁移到更高的版本号Oracle10G低版本号)
- 用PHP向数据库中实现简单的增删改查(纯代码)
- MySQL系列之E-2------MySQL主从复制实战
- 数据库 -- MYSQL免安装操作方法
- Memcahce(MC)系列(三)Memcached它PHP转让
- 基于mariadb的日志服务器及用loganalyzer实现日志的管理分析 推荐
- MySQL系列之E-1------MySQL主从复制原理
- Hive格式化输出数据库和表详细信息
- MySQL系列之D-2------MySQL多实例添加一个实例
- MySQL系列之D-1------MySQL多实例安装安装
- MySQL系列之B-1------MySQL安装准备工作
- MySQL系列之B-2------MySQL安装