[架构]Cache v0.1 alpha 使用说明
来源:互联网 发布:淘宝店铺有流量没转化 编辑:程序博客网 时间:2024/04/28 03:46
Cache V0.1 alpha
2011 瞿正峰版权所有,保留所有权利
中国 上海
一、概述
Cache V0.1 alpha版本是我用晚上的业余时间写的一个java缓存组件,目前只是在原型的测试阶段。
主要的设计目标是:简单方便
可以方便地加到应用中,可以满足日常应用中的大部分应用场景。
二、适用方法
目前设计有两种使用方法:简单对象方式,引擎方式(线程方式)
1、简单对象方式:
CacheTable cache = new CacheTable(); //使用默认设置
CacheTable cache = new CacheTable(CacheConstant.CACHE_TYPE_MULTIMAP); //指定使用的容器类型,是否支持table功能
CacheTable cache = new CacheTable(CacheConstant.CACHE_TYPE_MULTIMAP, CacheConstant.CACHE_PARSER_FULL); //指定使用的容器类型,是否支持table功能,是否支持计数,计时功能
2、引擎方式(线程方式)
需要在项目根目录下添加配置文件cache.ini。
CacheEngine engine = new CacheEngine();
engine.start(); //根据配置文件启动相应模式
engine.stop();
三、API接口
1、Cache基本操作
public Object put(Object key, Object value);
public Object get(Object key);
public boolean exists(Object key);
public boolean isEmpty();
public Object remove(Object key);
public boolean clear();
public long size();
public boolean putAll(Map map);
public Set entrySet(); //暂未支持
public Set keySet();
2、table功能
public boolean create(String tableName);
public boolean drop(String tableName);
public Object put(String tableName, Object key, Object value);
public Object get(String tableName, Object key);
public boolean exists(String tableName, Object key);
public boolean isEmpty(String tableName);
public Object remove(String tableName, Object key);
public boolean clear(String tableName);
public long size(String tableName);
public boolean putAll(String tableName, Map map);
public Set entrySet(String tableName); //暂未支持
public Set keySet(String tableName);
3、计数功能
public long getCount(Object key);
public void clearCount(Object key);
public long getCount(String tableName, Object key);
public void clearCount(String tableName, Object key);
4、计时功能
public long getTime(Object key);
public long getTime(String tableName, Object key);
public void setTime(int time);
public void setTimeout(int timeout);
public void execute();
public void execute(String tableName);
public void executeAll();
5、命中统计功能
public long getTotal();
public long getTotal(String tableName);
public long getHit();
public long getHit(String tableName);
四、下载地址
http://download.csdn.net/source/3465790
- [架构]Cache v0.1 alpha 使用说明
- [架构]F1Engine v0.1 alpha使用说明
- [框架]Cache v0.1 alpha 版权声明
- 凌云架构V0.1——序
- JAVA多服务器通讯框架-聊天功能演示程序 V0.1 alpha 发布并提供下载
- 凌云架构V0.1——写在开始之前
- 凌云架构V0.1——第一部分 Why架构?——第一章 新项目来了
- [内存管理]管理图解v0.1 v0.2 v0.3
- 架构使用说明用例
- 企业架构语言ArchiMate v0.5.pdf
- findlogin V0.1
- ESOE Specification v0.1
- mimisys pack v0.1
- 虚拟家庭 v0.1
- RayTracer v0.1
- Dump Buffer v0.1
- 文本框学习V0.1
- 七巧板 Chi7ren V0.1
- 消除oracle通配符的特殊含义
- GPIO编程(-)开发板重启
- 二叉树遍历(非递归版)
- 小偷程序很简单。。主要看函数。。
- C 添加, 读取配置文件 函数
- [架构]Cache v0.1 alpha 使用说明
- K-means算法
- GC FAQ -- draft
- table td 文字超出显示省略号
- 运算符优先级
- typedef define C复杂函数声明
- 深搜 IDA* 算法 POJ2286
- 不要只会编程
- [框架]Cache v0.1 alpha 版权声明