Example usage for org.springframework.data.redis.connection RedisConnection slaveOfNoOne

List of usage examples for org.springframework.data.redis.connection RedisConnection slaveOfNoOne

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection slaveOfNoOne.

Prototype

void slaveOfNoOne();

Source Link

Document

Change server into master.

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Change server into master./*from ww  w  . ja va  2 s.co m*/
 * <p>
 * See http://redis.io/commands/slaveof
 * 
 * @since 1.3
 */
public static void slaveOfNoOne() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.slaveOfNoOne();
            return null;
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Change server into master./*from w  w w  . ja v  a 2  s  . c  o m*/
 * <p>
 * See http://redis.io/commands/slaveof
 * 
 * @since 1.3
 */
public void slaveOfNoOne() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.slaveOfNoOne();
            return null;
        }
    });
}