最近在学memcache,在测试memcache计数器的功能时,发现一个问题。
String key ="abc";
System.out.println(memCachedClient.storeCounter(key, 10));
System.out.println(memCachedClient.incr(key,1));
System.out.println(memCachedClient.incr(key,1));
System.out.println(memCachedClient.getCounter(key));输出的结果是
true
-1
-1
-1
为什么计数器没有存储成功?
String key ="abc";
System.out.println(memCachedClient.storeCounter(key, 10));
System.out.println(memCachedClient.incr(key,1));
System.out.println(memCachedClient.incr(key,1));
System.out.println(memCachedClient.getCounter(key));输出的结果是
true
-1
-1
-1
为什么计数器没有存储成功?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货