莊周夢蝶

          生活、程序、未來
             :: 首頁 ::  ::  :: 聚合  :: 管理

          xmemcached發布1.3.3版本——支持touch和GAT

          Posted on 2011-06-12 13:32 dennis 閱讀(4230) 評論(3)  編輯  收藏 所屬分類: javamy open-source
              開源memcached的java客戶端xmemcached發布1.3.3,主要改進如下:

          1、memcached 1.6添加了不少新特性,具體可以參考《what's new in memcached》(1) (2)這兩個帖子。xmemcached將及時跟進這些新特性。1.3.3這個版本實現了二進制協議中新的兩個命令touch和GAT(get and touch)。這兩個功能可以說是千呼萬喚始出來,終于可以不用get-set來重新設置數據的超時時間,利用touch或者GAT可以簡單地更新數據的超時時間。1.3.3新增加四個方法:
              public boolean touch(final String key, int exp, long opTimeout)
                      
          throws TimeoutException, InterruptedException, MemcachedException;
              
          public boolean touch(final String key, int exp) throws TimeoutException,
                      InterruptedException, MemcachedException;
                  
          public <T> T getAndTouch(final String key, int newExp, long opTimeout)
                      
          throws TimeoutException, InterruptedException, MemcachedException;
              
          public <T> T getAndTouch(final String key, int newExp)
                      
          throws TimeoutException, InterruptedException, MemcachedException;

          其中touch用于設置數據新的超時時間,getAndTouch則是在獲取數據的同時更新超時時間。例如用memcached存儲session,可以在每次get的時候更新下數據的超時時間來保活。請注意,這四個方法僅在使用memcached 1.6并且使用二進制協議的時候有效

          2、setLoggingLevelVerbosity方法可以作用于二進制協議。


          3、重構錯誤處理模塊,使得異常信息更友好。


          4、將KeyIterator和getKeyIterator聲明為deprecated,因為memached 1.6將移除stats cachedump協議,并且stats cachedump返回數據有大小限制,遍歷功能不具實用性。

          5、修復Bug,包括issue 126 ,issue 127,issue 128,issue 129

          下載地址:http://code.google.com/p/xmemcached/downloads/list
          源碼:  https://github.com/killme2008/xmemcached
          maven引用:
           <dependency>
                
          <groupId>com.googlecode.xmemcached</groupId>
                
          <artifactId>xmemcached</artifactId>
                
          <version>1.3.3</version>
           
          </dependency>

          評論

          # re: xmemcached發布1.3.3版本——支持touch和GAT  回復  更多評論   

          2011-06-14 09:30 by 懶人網站助手
          不錯,也看看http://www.lrtool.net

          # re: xmemcached發布1.3.3版本——支持touch和GAT  回復  更多評論   

          2011-06-15 23:26 by RunCode
          不錯,跟進

          # re: xmemcached發布1.3.3版本——支持touch和GAT  回復  更多評論   

          2015-09-23 17:30 by 福利吧
          學習了~
          主站蜘蛛池模板: 时尚| 镇江市| 新泰市| 井研县| 衡南县| 昆山市| 福泉市| 公主岭市| 宜丰县| 布拖县| 金阳县| 牟定县| 兴安县| 东乡| 土默特右旗| 济源市| 聂荣县| 重庆市| 贺州市| 邻水| 巨野县| 荆门市| 闸北区| 亚东县| 莱西市| 兴隆县| 沅江市| 西丰县| 清原| 高密市| 德阳市| 肇州县| 景洪市| 搜索| 建水县| 特克斯县| 衡东县| 蓝山县| 高州市| 华蓥市| 长寿区|