问题描述
- Spymemcached incr 增长一个long型数据,报错说不是一个数值型值
-
版本spymemcached-2.10.1;
使用incr方法时报错。
我把一个long型数值放进memcached中:
MemClient.getInstance().increment("world-record", 1);
其中MemClient.getInstance()得到我的单例工具类,increment方法实质就是incr。但是报错:
2015-02-08 23:26:51.595 ERROR net.spy.memcached.protocol.ascii.MutatorOperationImpl: Error: CLIENT_ERROR cannot increment or decrement non-numeric value
2015-02-08 23:26:51.596 INFO net.spy.memcached.MemcachedConnection: Reconnection due to exception handling a memcached operation on {QA sa=localhost/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: incr Key: world-recordd Amount: 1, topWop=null, toWrite=0, interested=1}. This may be due to an authentication failure.
OperationException: CLIENT: CLIENT_ERROR cannot increment or decrement non-numeric value
at net.spy.memcached.protocol.BaseOperationImpl.handleError(BaseOperationImpl.java:169)
at net.spy.memcached.protocol.ascii.OperationImpl.readFromBuffer(OperationImpl.java:151)
at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:628)
at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:543)
at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:322)
at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:1047)
2015-02-08 23:26:51.597 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening {QA sa=localhost/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=1, topRop=Cmd: incr Key: world-recordd Amount: 1, topWop=null, toWrite=0, interested=1}, attempt 0.
2015-02-08 23:26:51.597 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: incr Key: world-recordd Amount: 1
2015-02-08 23:26:51.599 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for world-recordd.
2015-02-08 23:26:53.598 INFO net.spy.memcached.MemcachedConnection: Reconnecting {QA sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=1, #iq=0, topRop=null, topWop=Cmd: add Key: world-recordd Flags: 0 Exp: 0 Data Length: 1, toWrite=0, interested=0}2015-02-08 23:26:53.600 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@4edc35ba
请问这是什么原因?