莊周夢蝶

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

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

          Posted on 2011-06-12 13:32 dennis 閱讀(4231) 評論(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 福利吧
          學習了~
          主站蜘蛛池模板: 富裕县| 宁国市| 桑植县| 桃园市| 达尔| 罗源县| 溧阳市| 榆林市| 关岭| 南通市| 汉川市| 贡嘎县| 伊吾县| 娄烦县| 民和| 浑源县| 宁陕县| 云龙县| 辰溪县| 怀集县| 额尔古纳市| 西林县| 芦溪县| 阳高县| 当雄县| 宁国市| 新竹市| 贵港市| 乡宁县| 鹤山市| 尖扎县| 汕尾市| 临夏县| 固安县| 文昌市| 黑水县| 库尔勒市| 繁昌县| 丰宁| 隆林| 四子王旗|