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

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

Introduction

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

Prototype

void flushAll();

Source Link

Document

Delete all all keys from all databases.

Usage

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

/**
 * Delete all <b>all keys</b> from <b>all databases</b>.
 * <p>/*from  w w w.j a  v  a 2  s  .  co m*/
 * See http://redis.io/commands/flushall
 */
public static void flushAll() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.flushAll();
            return null;
        }
    });
}

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

/**
 * Delete all <b>all keys</b> from <b>all databases</b>.
 * <p>/*  w  ww .  j a  va 2  s  .  co  m*/
 * See http://redis.io/commands/flushall
 */
public void flushAll() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.flushAll();
            return null;
        }
    });
}

From source file:org.mitre.mpf.wfm.data.RedisImpl.java

/** Removes everything in the Redis datastore. */
public void clear() {
    redisTemplate.execute(new RedisCallback() {
        @Override/*from   w  ww  .j  a  v  a2 s.c o  m*/
        public Object doInRedis(RedisConnection redisConnection) throws DataAccessException {
            redisConnection.flushAll();
            return null;
        }
    });
}