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

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

Introduction

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

Prototype

@Nullable
<T> T evalSha(String scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs);

Source Link

Document

Evaluate given scriptSha .

Usage

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

/**
 * Evaluate given {@code scriptSha}./*  w  ww  .  ja v  a 2s.  c o m*/
 * <p>
 * See http://redis.io/commands/evalsha
 * 
 * @param <T> t
 * @param scriptSha scriptSha
 * @param returnType returnType
 * @param numKeys numKeys
 * @param keysAndArgs keysAndArgs
 * @return T
 * @since 1.5
 */
public static <T> T evalSha(String scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs) {
    return redisTemplate.execute(new RedisCallback<T>() {
        @Override
        public T doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.evalSha(scriptSha, returnType, numKeys, keysAndArgs);
        }
    });
}

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

/**
 * Evaluate given {@code scriptSha}./*from   w w  w  . ja  v  a2  s . co m*/
 * <p>
 * See http://redis.io/commands/evalsha
 * 
 * @param <T> t
 * @param scriptSha scriptSha
 * @param returnType returnType
 * @param numKeys numKeys
 * @param keysAndArgs keysAndArgs
 * @return T
 * @since 1.5
 */
public static <T> T evalSha(byte[] scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs) {
    return redisTemplate.execute(new RedisCallback<T>() {
        @Override
        public T doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.evalSha(scriptSha, returnType, numKeys, keysAndArgs);
        }
    });
}

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

/**
 * Evaluate given {@code scriptSha}./*from w w w . j a va 2s  .  co  m*/
 * <p>
 * See http://redis.io/commands/evalsha
 * 
 * @param <T> t
 * @param scriptSha scriptSha
 * @param returnType returnType
 * @param numKeys numKeys
 * @param keysAndArgs keysAndArgs
 * @return T
 * @since 1.5
 */
public <T> T evalSha(String scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs) {
    return redisTemplate.execute(new RedisCallback<T>() {
        @Override
        public T doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.evalSha(scriptSha, returnType, numKeys, keysAndArgs);
        }
    });
}

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

/**
 * Evaluate given {@code scriptSha}./*from   www . jav  a  2s .  c om*/
 * <p>
 * See http://redis.io/commands/evalsha
 * 
 * @param <T> t
 * @param scriptSha scriptSha
 * @param returnType returnType
 * @param numKeys numKeys
 * @param keysAndArgs keysAndArgs
 * @return T
 * @since 1.5
 */
public <T> T evalSha(byte[] scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs) {
    return redisTemplate.execute(new RedisCallback<T>() {
        @Override
        public T doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.evalSha(scriptSha, returnType, numKeys, keysAndArgs);
        }
    });
}