List of usage examples for org.springframework.data.redis.connection RedisConnection migrate
void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option);
From source file:com.zxy.commons.cache.RedisUtils.java
/** * @param key must not be {@literal null}. * @param target must not be {@literal null}. * @param dbIndex dbIndex/*from w w w . ja v a 2 s .c om*/ * @param option can be {@literal null}. Defaulted to {@link MigrateOption#COPY}. * @since 1.7 */ public static void migrate(byte[] key, RedisNode target, int dbIndex, MigrateOption option) { redisTemplate.execute(new RedisCallback<Void>() { @Override public Void doInRedis(RedisConnection redis) throws DataAccessException { redis.migrate(key, target, dbIndex, option); return null; } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * @param key must not be {@literal null}. * @param target must not be {@literal null}. * @param dbIndex dbIndex/*from ww w . j ava 2 s. c o m*/ * @param option can be {@literal null}. Defaulted to {@link MigrateOption#COPY}. * @since 1.7 */ public void migrate(byte[] key, RedisNode target, int dbIndex, MigrateOption option) { redisTemplate.execute(new RedisCallback<Void>() { @Override public Void doInRedis(RedisConnection redis) throws DataAccessException { redis.migrate(key, target, dbIndex, option); return null; } }); }