Java Code Examples for redis.clients.jedis.Jedis#rename()

The following examples show how to use redis.clients.jedis.Jedis#rename() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JedisUtil.java    From scaffold-cloud with MIT License 5 votes vote down vote up
/**
 * 重命名
 *
 * @param oldkey
 * @param newkey
 */
public static void rename(String oldkey, String newkey) {
    Jedis jedis = null;
    try {
        jedis = getResource();
        jedis.rename(oldkey, newkey);
    } finally {
        close(jedis);
    }
}
 
Example 2
Source File: DefaultRedis.java    From craft-atom with MIT License 4 votes vote down vote up
private String rename0(Jedis j, String key, String newkey) {
	return j.rename(key, newkey);
}
 
Example 3
Source File: JedisUtil.java    From Project with Apache License 2.0 3 votes vote down vote up
/**
 * 更改key
 * 
 * @param  oldkey
 * @param  newkey
 * @return 状态码
 */
public String rename(byte[] oldkey, byte[] newkey) {
	Jedis jedis = getJedis();
	String status = jedis.rename(oldkey, newkey);
	jedis.close();
	return status;
}
 
Example 4
Source File: JedisUtil.java    From BigData with GNU General Public License v3.0 3 votes vote down vote up
/**
 * 更改key
 * 
 * @param String
 *            oldkey
 * @param String
 *            newkey
 * @return 状态码
 * */
public String rename(byte[] oldkey, byte[] newkey) {
	Jedis jedis = getJedis();
	String status = jedis.rename(oldkey, newkey);
	returnJedis(jedis);
	return status;
}