{"action":"closed","issue":{"url":"https://api.github.com/repos/zhaozxc2010/Redis/issues/1","repository_url":"https://api.github.com/repos/zhaozxc2010/Redis","labels_url":"https://api.github.com/repos/zhaozxc2010/Redis/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/zhaozxc2010/Redis/issues/1/comments","events_url":"https://api.github.com/repos/zhaozxc2010/Redis/issues/1/events","html_url":"https://github.com/zhaozxc2010/Redis/issues/1","id":319449836,"number":1,"title":"Redis","user":{"login":"zhaozxc2010","id":20078748,"avatar_url":"https://avatars2.githubusercontent.com/u/20078748?v=4","gravatar_id":"","url":"https://api.github.com/users/zhaozxc2010","html_url":"https://github.com/zhaozxc2010","followers_url":"https://api.github.com/users/zhaozxc2010/followers","following_url":"https://api.github.com/users/zhaozxc2010/following{/other_user}","gists_url":"https://api.github.com/users/zhaozxc2010/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaozxc2010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaozxc2010/subscriptions","organizations_url":"https://api.github.com/users/zhaozxc2010/orgs","repos_url":"https://api.github.com/users/zhaozxc2010/repos","events_url":"https://api.github.com/users/zhaozxc2010/events{/privacy}","received_events_url":"https://api.github.com/users/zhaozxc2010/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-02T08:03:24Z","updated_at":"2018-05-02T08:16:38Z","closed_at":"2018-05-02T08:16:38Z","author_association":"OWNER","body":"import java.util.Date;\r\nimport java.util.HashSet;\r\nimport java.util.List;\r\nimport java.util.Map;\r\nimport java.util.Set;\r\n\r\nimport org.apache.log4j.Logger;\r\n\r\nimport redis.clients.jedis.Jedis;\r\nimport redis.clients.jedis.Transaction;\r\nimport redis.clients.jedis.exceptions.JedisException;\r\n\r\n/**\r\n * Redis操作类\r\n *\r\n */\r\npublic class Redis {\r\n\r\n\tprotected static final Logger logger = Logger.getLogger(Redis.class);\r\n\r\n\tprivate static final String SET_OK = \"OK\";\r\n\r\n\tprivate static final int SETNX_OK = 1;\r\n\r\n\r\n\tpublic static void expire(final String key, final int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.expire(String, String) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\tjedis.expire(key, expire);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[设置缓存生效时长方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[设置缓存生效时长]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * 添加一个key-value对\r\n\t * @param key\r\n\t * @param value\r\n\t * @param expire 过期时间（秒），0为自动删除、-1永不过期\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static boolean set(final String key, final String value, int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()\r\n\t\t\t\t|| null == value || value.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.set(String, String) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tString redisReturn = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\tredisReturn = jedis.setex(key, expire, value);\r\n\t\t\t} else {\r\n\t\t\t\tredisReturn = jedis.set(key, value);\r\n\t\t\t}\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[添加一个key-value对]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[添加一个key-value对]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[添加一个key-value对]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[添加一个key-value对]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn (redisReturn != null && redisReturn.equals(SET_OK)) ? true : false;\r\n\t}\r\n\r\n\t/**\r\n\t * 当key不存在时添加一个key-value对，key存在则不添加\r\n\t * @param key\r\n\t * @param value\r\n\t * @param expire 过期时间（秒），0为自动删除、-1永不过期\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static boolean setNx(final String key, final String value, int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()\r\n\t\t\t\t|| null == value || value.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.setNx(String, String, int) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tLong redisReturn = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tredisReturn = jedis.setnx(key, value);\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\tjedis.expire(key, expire);\r\n\t\t\t}\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"Redis.setNx() 方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"Redis.setNx() 方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"Redis.setNx() 方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"Redis.setNx() 方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn (redisReturn != null && redisReturn.longValue() == SETNX_OK) ? true : false;\r\n\t}\r\n\t\r\n\t/**\r\n\t * 获取一个key-value对\r\n\t * @param key\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static String get(final String key) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.get(String) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tString value = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tvalue = jedis.get(key);\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[获取一个key-value对]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[获取一个key-value对]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[获取一个key-value对]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[获取一个key-value对]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * 根据key删除key-value对\r\n\t * @param keys\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static void del(final String... keys) throws Exception {\r\n\t\tif (null == keys || keys.length == 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.del(String) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tjedis.del(keys);\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[根据key删除key-value对]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[根据key删除key-value对]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[根据key删除key-value对]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[根据key删除key-value对]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * 添加一个key-value对（自定义类型）\r\n\t * @param <T>\r\n\t * @param key: redis key\r\n\t * @param t: redis value 自定义对象\r\n\t * @param expire redis 失效时间\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static <T> boolean setT(final String key, final T t, int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()\r\n\t\t\t\t|| null == t) {\r\n\t\t\tthrow new IllegalArgumentException(\"<T> Redis.setT(String, T) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tString redisReturn = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\tredisReturn = jedis.setex(key.getBytes(), expire, SerializeUtil.serialize(t));\r\n\t\t\t} else {\r\n\t\t\t\tredisReturn = jedis.set(key.getBytes(), SerializeUtil.serialize(t));\r\n\t\t\t}\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[添加一个key-value对（自定义类型）]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[添加一个key-value对（自定义类型）]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[添加一个key-value对（自定义类型）]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[添加一个key-value对（自定义类型）]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn (redisReturn != null && redisReturn.equals(SET_OK)) ? true : false;\r\n\t}\r\n\r\n\t/**\r\n\t * 获取一个key-value对（自定义类型）\r\n\t * @param <T>\r\n\t * @param key redis key\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static <T> T getT(final String key) throws Exception {\r\n\t\tif (null == key || key.isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"<T> Redis.getT(String) parameters are empty value.\");\r\n\t\t}\r\n\r\n\t\tT t = null;\r\n\t\tJedis jedis = null;\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tbyte[] buf = jedis.get(key.getBytes());\r\n\t\t\tif (null == buf || buf.length == 0) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tt = (T) SerializeUtil.unserialize(buf);\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[获取一个key-value对（自定义类型）]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[获取一个key-value对（自定义类型）]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[获取一个key-value对（自定义类型）]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[获取一个key-value对（自定义类型）]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn t;\r\n\t}\r\n\r\n\t/** -----------------------------------------------------------------------------\r\n\t * 将 key 中储存的数字值增一（永不失效）\r\n\t * @param key redis key\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static long incr(String key) throws Exception {\r\n\t\treturn incr(key, 0);\r\n\t}\r\n\r\n\t/**\r\n\t * 将 key 中储存的数字值增一\r\n\t * @param key redis key\r\n\t * @param expire redis 失效时间（秒）\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static long incr(String key, int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"<T> Redis.incr(String, int) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tlong redisReturn;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tredisReturn = jedis.incr(key);\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\tjedis.expire(key, expire);\r\n\t\t\t}\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[将 key 中储存的数字值增一]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[将 key 中储存的数字值增一]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[将 key 中储存的数字值增一]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[将 key 中储存的数字值增一]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn redisReturn;\r\n\t}\r\n\r\n\t/** -----------------------------------------------------------------------------\r\n\t * 将 key 中储存的数字值减一（永不失效）\r\n\t * @param key redis key\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static long decr(String key) throws Exception {\r\n\t\treturn decr(key, 0);\r\n\t}\r\n\r\n\t/**\r\n\t * 将 key 中储存的数字值减一\r\n\t * @param key redis key\r\n\t * @param expire redis 失效时间（秒）\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static long decr(String key, int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"<T> Redis.decr(String, int) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tlong redisReturn;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tredisReturn = jedis.decr(key);\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\tjedis.expire(key, expire);\r\n\t\t\t}\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[将 key 中储存的数字值减一]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[将 key 中储存的数字值减一]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[将 key 中储存的数字值减一]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[将 key 中储存的数字值减一]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn redisReturn;\r\n\t}\r\n\r\n\t/** List集合 -----------------------------------------------------------------------------\r\n\t * 将arr元素添加到list集合的表尾，如果list集合不存在则创建\r\n\t * @param key: redis key\r\n\t * @param arr: redis value\r\n\t * @param expire: redis 失效时间\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static Long rpush(final String key, final String[] arr, int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()\r\n\t\t\t\t|| null == arr || arr.length == 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.rpush() parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tLong redisReturn = null;\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tif (arr.length == 1) {\r\n\t\t\t\tredisReturn = jedis.rpush(key, arr[0]);\r\n\t\t\t\tif (expire > 0) {\r\n\t\t\t\t\tredisReturn = jedis.expire(key, expire);\r\n\t\t\t\t}\r\n\t\t\t\treturn redisReturn;\r\n\t\t\t}\r\n\r\n\t\t\tTransaction tx = jedis.multi();\r\n\t\t\tfor (String s: arr) {\r\n\t\t\t\ttx.rpush(key, s);\r\n\t\t\t}\r\n\t\t\tList result = tx.exec();\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\tjedis.expire(key, expire);\r\n\t\t\t}\r\n\t\t\treturn (Long) result.get(result.size() - 1);\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[将arr元素添加到list集合的表尾]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[将arr元素添加到list集合的表尾]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e2) {\r\n\t\t\t\t\tlogger.error(\"[将arr元素添加到list集合的表尾]方法中returnResource(jedis)错误\", e2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * 获取List集合\r\n\t * @param key: redis key\r\n\t * @param start: 获取redis list集合数据的开始索引\r\n\t * @param end: 获取redis list集合数据的结束索引\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static List<String> lrange(final String key, final long start, long end) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.lrange() parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\treturn jedis.lrange(key, start, end);\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[获取List集合]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[获取List集合]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e2) {\r\n\t\t\t\t\tlogger.error(\"[获取List集合]方法中returnResource(jedis)错误\", e2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/** Set集合 -----------------------------------------------------------------------------\r\n\t * 创建set集合，若集合存在则将元素加入set集合中\r\n\t * @param key: redis key\r\n\t * @param members: redis value\r\n\t * @param expire: redis 失效时间\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static boolean sadd(final String key, final Set<String> members, int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()\r\n\t\t\t\t|| null == members || members.size() == 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.sadd() parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\r\n\t\t\tTransaction tx = jedis.multi();\r\n\t\t\tfor (String member: members) {\r\n\t\t\t\ttx.sadd(key, member);\r\n\t\t\t}\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\ttx.expire(key, expire);\r\n\t\t\t}\r\n\t\t\tList result = tx.exec();\r\n//\t\t\treturn (Long) result.get(result.size() - 1);\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[创建set集合，若集合存在则将元素加入set集合中]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[创建set集合，若集合存在则将元素加入set集合中]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e2) {\r\n\t\t\t\t\tlogger.error(\"[创建set集合，若集合存在则将元素加入set集合中]方法中returnResource(jedis)错误\", e2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * 创建set集合，若集合存在则将元素加入set集合中（自定义类型）\r\n\t * @param <T>: 自定义类型\r\n\t * @param key: redis key\r\n\t * @param members: redis value（自定义类型）\r\n\t * @param expire: redis 失效时间\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static <T> boolean saddT(final String key, final Set<T> members, int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()\r\n\t\t\t\t|| null == members || members.size() == 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"<T> Redis.saddT() parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tTransaction tx = jedis.multi();\r\n\t\t\tfor (T t : members) {\r\n\t\t\t\ttx.sadd(key.getBytes(), SerializeUtil.serialize(t));\r\n\t\t\t}\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\ttx.expire(key.getBytes(), expire);\r\n\t\t\t}\r\n\t\t\ttx.exec();\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[创建set集合，若集合存在则将元素加入set集合中（自定义类型）]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[创建set集合，若集合存在则将元素加入set集合中（自定义类型）]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e2) {\r\n\t\t\t\t\tlogger.error(\"[创建set集合，若集合存在则将元素加入set集合中（自定义类型）]方法中returnResource(jedis)错误\", e2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * 从set集合中获取全部元素\r\n\t * @param key: redis key\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static Set<String> smembers(final String key) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.smembers(String) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tSet<String> members = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tmembers = jedis.smembers(key);\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[从Set集合中获取全部元素]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[从Set集合中获取全部元素]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[从Set集合中获取全部元素]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn members;\r\n\t}\r\n\r\n\t/**\r\n\t * 获取set集合中全部元素（自定义类型）\r\n\t * @param <T>\r\n\t * @param key: redis key\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static <T> Set<T> smembersT(final String key) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"<T> Set<T> Redis.smembersT(key) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tSet<byte[]> byteSet = null;\r\n\t\tT t = null;\r\n\t\tSet<T> members = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tbyteSet = jedis.smembers(key.getBytes());\r\n\t\t\tif (byteSet != null && byteSet.size() > 0) {\r\n\t\t\t\tmembers = new HashSet<T>();\r\n\t\t\t\tfor (byte[] buf : byteSet) {\r\n\t\t\t\t\tt = (T) SerializeUtil.unserialize(buf);\r\n\t\t\t\t\tmembers.add(t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[获取set集合中全部元素（自定义类型）]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[获取set集合中全部元素（自定义类型）]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[获取set集合中全部元素（自定义类型）]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[获取集合key中全部元素（自定义类型）]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn members;\r\n\t}\r\n\r\n\t/** Hash -----------------------------------------------------------------------------\r\n\t * 添加hash类型数据\r\n\t * @param key: redis key\r\n\t * @param hash: redis value\r\n\t * @param expire: redis 失效时间\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static boolean hmset(final String key, final Map<String, String> hash, int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()\r\n\t\t\t\t|| null == hash || hash.isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.hmset(key, map, expire) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tTransaction tx = jedis.multi();\r\n\t\t\ttx.hmset(key, hash);\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\ttx.expire(key, expire);\r\n\t\t\t}\r\n\t\t\ttx.exec();\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[添加hash类型数据]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[添加hash类型数据]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[添加hash类型数据]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[添加hash类型数据]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * 添加hash类型数据（自定义类型）\r\n\t * @param key: redis key\r\n\t * @param hash: redis hash类型数据的value（自定义类型）\r\n\t * @param expire: redis 失效时间\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static boolean hmsetT(final String key, final Map<byte[], byte[]> hash, int expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()\r\n\t\t\t\t|| null == hash || hash.isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"boolean Redis.hmsetT(key, map, expire) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tTransaction tx = jedis.multi();\r\n\t\t\ttx.hmset(key.getBytes(), hash);\r\n\t\t\tif (expire > 0) {\r\n\t\t\t\ttx.expire(key, expire);\r\n\t\t\t}\r\n\t\t\ttx.exec();\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[添加hash类型数据（自定义类型）]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[添加hash类型数据（自定义类型）]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[添加hash类型数据（自定义类型）]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[添加hash类型数据（自定义类型）]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\r\n\tpublic static List<String> hmget(final String key, final String[] hashKey) throws Exception {\r\n\t\treturn hmget(key, hashKey, null);\r\n\t}\r\n\t/**\r\n\t * 获取hash类型中指定hashKey的value值\r\n\t * @param key: redis key\r\n\t * @param hashKey: redis hash类型数据的key\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static List<String> hmget(final String key, final String[] hashKey, final Integer expire) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()\r\n\t\t\t\t|| null == hashKey || hashKey.length == 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.hmget(key, hashKey) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tList<String> list = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tlist = jedis.hmget(key, hashKey);\r\n\t\t\tif (expire != null && expire > 0) {\r\n\t\t\t\tjedis.expire(key, expire);\r\n\t\t\t}\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[获取hash类型中指定hashKey的value值]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[获取hash类型中指定hashKey的value值]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[获取hash类型中指定hashKey的value值]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[获取hash类型中指定hashKey的value值]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\t/**\r\n\t * 获取hash类型中指定hashKey的value值（自定义类型）\r\n\t * @param key: redis key\r\n\t * @param hashKey: redis hash类型数据的key（自定义类型）\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static List<byte[]> hmgetT(final String key, final byte[] hashKey) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()\r\n\t\t\t\t|| null == hashKey || hashKey.length == 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"List<byte[]> Redis.hmgetT(key, hashKey) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tList<byte[]> list = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\tlist = jedis.hmget(key.getBytes(), hashKey);\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[获取hash类型中指定hashKey的value值（自定义类型）]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[获取hash类型中指定hashKey的value值（自定义类型）]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[获取hash类型中指定hashKey的value值（自定义类型）]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[获取hash类型中指定hashKey的value值（自定义类型）]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\t/**\r\n\t * 获取hash类型中全部hashKey-value对\r\n\t * @param key: redis key\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static Map<String, String> hgetAll(final String key) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"Redis.hgetAll(key) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tMap<String, String> hash = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\thash = jedis.hgetAll(key);\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[获取hash类型中全部hashKey-value对]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[获取hash类型中全部hashKey-value对]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[获取hash类型中全部hashKey-value对]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[获取hash类型中全部hashKey-value对]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn hash;\r\n\t}\r\n\r\n\t/**\r\n\t * 获取hash类型中全部hashKey-value对（自定义类型）\r\n\t * @param key: redis key\r\n\t * @return\r\n\t * @throws Exception\r\n\t */\r\n\tpublic static Map<byte[], byte[]> hgetAllT(final String key) throws Exception {\r\n\t\tif (null == key || key.trim().isEmpty()) {\r\n\t\t\tthrow new IllegalArgumentException(\"Map<byte[], byte[]> Redis.hgetAll(key) parameters are empty value.\");\r\n\t\t}\r\n\t\tJedis jedis = null;\r\n\t\tMap<byte[], byte[]> hash = null;\r\n\r\n\t\ttry {\r\n\t\t\tjedis = RedisPool.pool.getResource();\r\n\t\t\thash = jedis.hgetAll(key.getBytes());\r\n\t\t} catch (JedisException je) {\r\n\t\t\tlogger.error(\"[获取hash类型中全部hashKey-value对（自定义类型）]方法异常\", je);\r\n\t\t\ttry {\r\n\t\t\t\tRedisPool.pool.returnBrokenResource(jedis);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\tlogger.error(\"[获取hash类型中全部hashKey-value对（自定义类型）]方法异常中returnBrokenResource(jedis)错误\", e1);\r\n\t\t\t}\r\n\t\t\tjedis = null;\r\n\t\t\tthrow new Exception(je);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"[获取hash类型中全部hashKey-value对（自定义类型）]方法异常\", e);\r\n\t\t\tthrow new Exception(e);\r\n\t\t} finally {\r\n\t\t\tif (jedis != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tRedisPool.pool.returnResource(jedis);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"[获取hash类型中全部hashKey-value对（自定义类型）]方法中returnResource(jedis)错误\", e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn hash;\r\n\t}\r\n\r\n\tpublic static void main(String[] args) {\r\n\r\n\t\t//27496111119009\r\n\t\tSystem.out.println(System.nanoTime());\r\n\t\tSystem.out.println(new Date().getTime());\r\n\r\n\t\t/*try {\r\n\t\t\tincr(\"key_incr\", 0);\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}*/\r\n\r\n\t}\r\n}\r\n"}}
{"actor":{"display_login":"zhaozxc2010"}}