/** 获取记数器的值 */ public Long getCounter(Object key) { Jedis jedis = getJedis(); try { return Long.parseLong((String) jedis.get(keyNamingPolicy.getKeyName(key))); } finally { close(jedis); } }
protected byte[] keyToBytes(Object key) { String keyStr = keyNamingPolicy.getKeyName(key); return serializer.keyToBytes(keyStr); }