Xmemcached 1.2.2發布——支持遍歷所有key
Posted on 2010-01-12 18:13 dennis 閱讀(4506) 評論(7) 編輯 收藏 所屬分類: java 、my open-source Java Memcached Client——Xmemcached的新版本1.2.2正式released。這個小版本最主要的改進是允許遍歷所有在memcached中的key,這是通過stats協議實現,具體信息可以看這里。
1.2.2的主要改進如下:
1、添加一個KeyIterator接口,這個迭代器接口用于遍歷memcached中的所有key。由于是基于stats協議實現的,因此這個迭代過程并非高效,請慎重使用,并且迭代返回的key也并非實時,而是當前快照。KeyIterator目前僅在文本協議下可用,使用例子如下:
2、添加一個新類net.rubyeye.xmemcached.Counter,用于封裝原始的incr/decr方法,提供類似AtomicLong原子類的API方便計數器的使用:
3、修復BUG,如issue 71,issue 72,issue 70 etc.
4、聲明廢棄 net.rubyeye.xmemcached.buffer.BufferAllocator,現在哪怕你設置了這一屬性也將被忽略,這個類將在以后的某個版本中移除
5、升級yanf4j到1.1.0
Wiki和用戶指南都已經更新,歡迎使用并反饋任何建議或者bug報告。
項目主頁:http://code.google.com/p/xmemcached/
下載地址:http://code.google.com/p/xmemcached/downloads/list
1.2.2的主要改進如下:
1、添加一個KeyIterator接口,這個迭代器接口用于遍歷memcached中的所有key。由于是基于stats協議實現的,因此這個迭代過程并非高效,請慎重使用,并且迭代返回的key也并非實時,而是當前快照。KeyIterator目前僅在文本協議下可用,使用例子如下:
MemcachedClient client=
KeyIterator it=client.getKeyIterator(AddrUtil.getOneAddress("localhost:11211"));
while(it.hasNext())
{
String key=it.next();
}

KeyIterator it=client.getKeyIterator(AddrUtil.getOneAddress("localhost:11211"));
while(it.hasNext())
{
String key=it.next();
}
2、添加一個新類net.rubyeye.xmemcached.Counter,用于封裝原始的incr/decr方法,提供類似AtomicLong原子類的API方便計數器的使用:
Counter counter=client.getCounter("counter",0);
counter.incrementAndGet();
counter.decrementAndGet();
counter.addAndGet(-10);
counter.incrementAndGet();
counter.decrementAndGet();
counter.addAndGet(-10);
3、修復BUG,如issue 71,issue 72,issue 70 etc.
4、聲明廢棄 net.rubyeye.xmemcached.buffer.BufferAllocator,現在哪怕你設置了這一屬性也將被忽略,這個類將在以后的某個版本中移除
5、升級yanf4j到1.1.0
Wiki和用戶指南都已經更新,歡迎使用并反饋任何建議或者bug報告。
項目主頁:http://code.google.com/p/xmemcached/
下載地址:http://code.google.com/p/xmemcached/downloads/list