<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    半生心半生緣

    JAVA人生篇章

    OsCache配置

    jacky寫于2006年廣州
    花了一點(diǎn)時間,翻譯了OsCache的配置屬性:
    E文地址:http://wiki.opensymphony.com/display/CACHE/Configuration
    簡潔翻譯如下:后面部分懶得去翻譯了...哈哈
    Configuration:配置oscache.properties
    1、cache.memory:
    true 或者 false。默認(rèn)為true
    不使用內(nèi)存緩存而使用硬盤緩存是很愚蠢的事情。
    2、cache.capacity
    緩存object的最大數(shù)量值。默認(rèn)是不限制,cache不會移走任何緩存內(nèi)容。負(fù)數(shù)被當(dāng)作不限制。
    3、cache.algorithm
    運(yùn)算規(guī)則。為了使用規(guī)則,cache的size必須是指定的。
    如果cache的size不指定的話,法則將不會限制緩存對象的大小。
    如果你指定了cache的size,但不指定algorithm,那它會默認(rèn)使用:com.opensymphony.oscache.base.algorithm.LRUCache
    有下面三種規(guī)則:
    com.opensymphony.oscache.base.algorithm.LRUCache-last in first out,最遲插入的最先調(diào)用。默認(rèn)值。
    com.opensymphony.oscache.base.algorithm.FIFOCache -first int first out。
    com.opensymphony.oscache.base.algorithm.UnlimitedCache -cache中的內(nèi)容將永遠(yuǎn)不會被丟棄。
    如果cache.capacity不指定值的話,它將被設(shè)為默認(rèn)。
    4、cache.blocking
    是否同步化。true 或者 false。一般設(shè)為true,避免讀取臟數(shù)據(jù)。
    5。cache.unlimited.disk
    指定硬盤緩存是否要作限制。默認(rèn)值為false。false的狀況下,disk cache capacity 將和cache.capacity的值相同。
    6、cache.persistence.class
    指定類是被持久化的類。class必須實(shí)現(xiàn)PersistenceListener接口。
    作為硬盤持久,可以實(shí)現(xiàn)com.opensymphony.oscache.plugins.diskpersistence.HashDiskPersistenceListener接口。
    它把class的toString()輸出的hash值作為文件的名稱。如果你要把文件名易讀(自己設(shè)定),DiskPersistenceListener 的父類也
    能使用,但其可能有非法字符或者過長的名字。
    注意:HashDiskPersistenceListener 和 DiskPersistenceListener 需要設(shè)定硬盤路徑:cache.path
    7、cache.path
    指定硬盤緩存的路徑。目錄如果不存在將被建立。同時注意oscache應(yīng)該要有權(quán)限寫文件系統(tǒng)。
    cache.path=c:\\myapp\\cache
    or *ix:
    cache.path=/opt/myapp/cache
    8、cache.persistence.overflow.only (NEW! Since 2.1)
    指定是否只有在內(nèi)存不足的情況下才使用硬盤緩存。
    默認(rèn)值false。但推薦是true如果內(nèi)存cache被允許的話。這個屬性徹底的改變了cache的行為,使得persisted cache
    和memory完全不同。
    9、cache.event.listeners
    用逗號分離的class名列表。每個class必須實(shí)現(xiàn)以下接口之一,或者幾個
    CacheEntryEventListener:接收cache add/update/flush and remove事件
    CacheMapAccessEventListener :接收cache訪問事件。這個可以讓你跟蹤cache怎么工作。
    默認(rèn)是不配置任何class的。當(dāng)然你可以使用一下的class:
    com.opensymphony.oscache.plugins.clustersupport.BroadcastingCacheEventListener -分布式的監(jiān)聽器。可以廣播到局域網(wǎng)內(nèi)的其他cache實(shí)例。
    com.opensymphony.oscache.extra.CacheEntryEventListenerImpl -一個簡單的監(jiān)聽器。在cache的生命周期中記錄count of 所有entry的事件。
    com.opensymphony.oscache.extra.CacheMapAccessEventListenerImpl -記錄count of cache map events(cache hits,misses and state hits).
    10、cache.key
    This is the key that will be used by the ServletCacheAdministrator
    (and hence the custom tags) to store the cache object in the application and session scope.
    The default value when this property is not specified is "__oscache_cache". If you want to access this default value in your code, it is available as com.opensymphony.oscache.base.Const.DEFAULT_CACHE_KEY.
    11、cache.use.host.domain.in.key
    If your server is configured with multiple hosts, you may wish to add host name information to automatically generated cache keys. If so, set this property to true. The default value is false.
    12、Additional Properties
    In additon to the above basic options, any other properties that are specified in this file will still be loaded and can be made available to your event handlers. For example, the JavaGroupsBroadcastingListener supports the following additional properties:
    13、cache.cluster.multicast.ip
    The multicast IP to use for this cache cluster. Defaults to 231.12.21.132.
    14、cache.cluster.properties
    Specifies additional configuration options for the clustering. The default setting is

    UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;\
    mcast_send_buf_size=150000;mcast_recv_buf_size=80000):\
    PING(timeout=2000;num_initial_members=3):\
    MERGE2(min_interval=5000;max_interval=10000):\
    FD_SOCK:VERIFY_SUSPECT(timeout=1500):\
    pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\
    UNICAST(timeout=300,600,1200,2400):\
    pbcast.STABLE(desired_avg_gossip=20000):\
    FRAG(frag_size=8096;down_thread=false;up_thread=false):\
    pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)

    posted on 2006-04-29 00:06 jackyhuang 閱讀(4051) 評論(4)  編輯  收藏

    評論

    # re: OsCache配置 2006-04-30 11:29 bluet

    哈哈,你也翻譯起e文來了  回復(fù)  更多評論   

    # re: OsCache配置 2006-04-30 14:38 jackyhuang

    呵呵,沒辦法.這些玩意還是e文比較原始些.  回復(fù)  更多評論   

    # re: OsCache配置 2006-05-02 22:06 pc

    辛苦了 : )  回復(fù)  更多評論   

    # re: OsCache配置 2010-01-06 12:57 茂林黃

    劉小輝?  回復(fù)  更多評論   


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     
    <2006年4月>
    2627282930311
    2345678
    9101112131415
    16171819202122
    23242526272829
    30123456

    導(dǎo)航

    統(tǒng)計

    公告

    2006年4月29號凌晨0點(diǎn)開通我的blog http://www.1001m.com

    常用鏈接

    留言簿(2)

    隨筆檔案

    文章分類

    文章檔案

    夢境家園

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲精品乱码久久久久66| 免费看一级做a爰片久久| 国产成A人亚洲精V品无码性色| 久久亚洲AV成人无码国产最大| 最近免费中文字幕大全| 亚洲一区二区三区精品视频| 在线看片免费不卡人成视频| 亚洲一区二区免费视频| 成人免费午夜视频| 亚洲爆乳成av人在线视菜奈实| 婷婷亚洲天堂影院| 国产精品1024在线永久免费| 亚洲精品无码av人在线观看 | 亚洲无人区码一二三码区别图片 | 国产美女精品视频免费观看| 亚洲AV无码国产剧情| 国产一区二区视频免费| 免费视频成人国产精品网站| 亚洲人成人77777网站| 91久久青青草原线免费| 久久亚洲精品专区蓝色区| 好大好硬好爽免费视频| 91av免费观看| 67194在线午夜亚洲| 小小影视日本动漫观看免费| 又长又大又粗又硬3p免费视频| 亚洲精品乱码久久久久久| 每天更新的免费av片在线观看| 亚洲成av人无码亚洲成av人| 伊人亚洲综合青草青草久热| 91麻豆国产免费观看| 亚洲av无码专区亚洲av不卡| 亚洲自偷自偷在线制服 | 亚洲A∨无码一区二区三区| 18勿入网站免费永久| 理论亚洲区美一区二区三区| 国产精品国产亚洲精品看不卡| 一二三四影视在线看片免费| 十八禁的黄污污免费网站| 亚洲蜜芽在线精品一区| 国产jizzjizz免费视频|