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

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

Introduction

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

Prototype

@Nullable
Long lLen(byte[] key);

Source Link

Document

Get the size of list stored at key .

Usage

From source file:com.mauersu.util.redis.DefaultListOperations.java

public Long size(K key) {
    final byte[] rawKey = rawKey(key);
    return execute(new RedisCallback<Long>() {

        public Long doInRedis(RedisConnection connection) {
            connection.select(dbIndex);//ww  w  .j av  a  2s  . c o  m
            return connection.lLen(rawKey);
        }
    }, true);
}

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

/**
 * Get the size of list stored at {@code key}.
 * <p>/*from   w  w  w.  j a va  2s.co  m*/
 * See http://redis.io/commands/llen
 * 
 * @param key key
 * @return Long
 */
public static Long lLen(byte[] key) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.lLen(key);
        }
    });
}

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

/**
 * Get the size of list stored at {@code key}.
 * <p>/* w ww.  ja va  2  s .c o  m*/
 * See http://redis.io/commands/llen
 * 
 * @param key key
 * @return Long
 */
public Long lLen(byte[] key) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.lLen(key);
        }
    });
}