JCS官方文档的简单笔记,仅供自己参考

1. 基本配置

jcs.default=DC
jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000 (The maximum number of items allowed in memory)
jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
jcs.default.cacheattributes.UseMemoryShrinker=true (内存清理,设为true时会扫描内存,删除过期的和空闲时间超期的item)
jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600 (specifies how long an object can be in memory before it is subjected to removal or being spooled to a disk cache if it is available,指定了在内存中的存活时间,超时的如果还available会被写入磁盘,只在设置了memory shrinker后有效)
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 (how often the shrinker should run,只在设置了memory shrinker后有效)

jcs.default.cacheattributes.DiskUsagePatternName=SWAP (SWAP, UPDATE, JDBC)
jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false (是否永久有效)
jcs.default.elementattributes.MaxLifeSeconds=700 (the maximum life of an item,指定了生命周期,超时的item不能被get到,如果设置了MemoryShinker,则会被清理)
jcs.default.elementattributes.IdleTime=1800 (the maximum time an item can live without being accessed,指定了item的最长空闲时间)
jcs.default.elementattributes.IsSpool=true (是否写入磁盘)
jcs.default.elementattributes.IsRemote=true (是否发送给远程服务器)
jcs.default.elementattributes.IsLateral=true (是否并行分布)

 

2. LTCP

jcs.auxiliary.LTCP=org.apache.commons.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory
jcs.auxiliary.LTCP.attributes=org.apache.commons.jcs.auxiliary.lateral.socket.tcp.TCPLateralCacheAttributes
#jcs.auxiliary.LTCP.attributes.TcpServers=localhost:1111,localhost:1112 (
This is the list of servers this cache should try to connect to. With UDP discovery this is not necessary)
jcs.auxiliary.LTCP.attributes.TcpListenerPort=1118 (本地cache监听的端口)
jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.8 (并行cache的ip)
jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780 (并行cache的udp端口)
jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true (
UDP discovery是否开启)
jcs.auxiliary.LTCP.attributes.Receive=true (false时只发送数据,true时接收并行cache发送的数据)
jcs.auxiliary.LTCP.attributes.AllowGet=false (是否允许本地cache从并行cache那里get,被
PutOnlyMode属性控制)
jcs.auxiliary.LTCP.attributes.IssueRemoveOnPut=false (ture时,用remove代替put,数据一致性更强些)
jcs.auxiliary.LTCP.attributes.FilterRemoveByHashCode=false (
If this is true, and IssueRemoveOnPut is true, the client will include the hashCode of the element to remove. If it is also true on the receiving end, the receiver will check to see if the element exists. If the element exists, and the hashCodes are the same, the item will not be removed)
jcs.auxiliary.LTCP.attributes.SocketTimeoOt=1001 (
socket (read) timeout)
jcs.auxiliary.LTCP.attributes.OpenTimeOut=2002 (
socket open timeout)
jcs.auxiliary.LTCP.attributes.ZombieQueueMaxSize=2000 (与并行cache连接异常时,未同步事件的列表长度)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值