Package redis.clients.jedis

Examples of redis.clients.jedis.Jedis.hmget()


    public List<Object> hmGet(String key, String... fields) throws Exception {
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            List<byte[]> hmget = jedis.hmget(SafeEncoder.encode(key),
                    encodeArray(fields));
            LOG.info("hmGet key:" + key + " fields:" + Arrays.toString(fields));
            if (CollectionUtils.isEmpty(hmget)) {
                return new ArrayList<Object>(1);
            } else {
View Full Code Here


    public List<String> hmGetByStringSerializer(String key, String... fields)
            throws Exception {
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            List<String> hmget = jedis.hmget(key, fields);
            LOG.info("hmGet key:" + key + " fields:" + Arrays.toString(fields));
            if (CollectionUtils.isEmpty(hmget)) {
                return new ArrayList<String>(1);
            } else {
                return hmget;
View Full Code Here

    @Override
    public Channel getChannel(final String channelId) throws ChannelNotFoundException {
        final Jedis jedis = jedisPool.getResource();
        try {
            final List<String> endpointTokenAndUaid = jedis.hmget(chidLookupKey(channelId), TOKEN_KEY, UAID_KEY);
            if (!endpointTokenAndUaid.isEmpty()) {
                final String endpointToken = endpointTokenAndUaid.get(0);
                final String uaid = endpointTokenAndUaid.get(1);
                if (endpointToken == null || uaid == null) {
                    throw channelNotFoundException(channelId);
View Full Code Here

    @Override
    public String saveUnacknowledged(final String channelId, final long version) {
        final Jedis jedis = jedisPool.getResource();
        try {
            jedis.set(ackLookupKey(channelId), Long.toString(version));
            final List<String> hashValues = jedis.hmget(chidLookupKey(channelId), UAID_KEY);
            final String uaid = hashValues.get(0);
            jedis.sadd(acksLookupKey(uaid), channelId);
            return uaid;
        } finally {
            jedisPool.returnResource(jedis);
View Full Code Here

    public List<Object> hmGet(String key, String... fields) throws Exception {
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            List<byte[]> hmget = jedis.hmget(SafeEncoder.encode(key),
                    encodeArray(fields));
            LOG.info("hmGet key:" + key + " fields:" + Arrays.toString(fields));
            if (CollectionUtils.isEmpty(hmget)) {
                return new ArrayList<Object>(1);
            } else {
View Full Code Here

    public List<String> hmGetByStringSerializer(String key, String... fields)
            throws Exception {
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            List<String> hmget = jedis.hmget(key, fields);
            LOG.info("hmGet key:" + key + " fields:" + Arrays.toString(fields));
            if (CollectionUtils.isEmpty(hmget)) {
                return new ArrayList<String>(1);
            } else {
                return hmget;
View Full Code Here

          max = localDateToDouble(end);
        }
        Set<String> dateTexts = jedis.zrangeByScore(redisHtsDaysKey, min, max);
        if (!dateTexts.isEmpty()) {
          String redisHtsDatapointKey = toRedisHtsDatapointKey(redisKey);
          List<String> valueTexts = jedis.hmget(redisHtsDatapointKey, dateTexts.toArray(new String[dateTexts.size()]));
         
          List<Integer> times = Lists.newArrayListWithCapacity(dateTexts.size());
          List<Double> values = Lists.newArrayListWithCapacity(valueTexts.size());
         
          Iterator<String> dateItr = dateTexts.iterator();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.