Examples of hmget()


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

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

    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

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

    @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

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

    @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

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

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

    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

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

          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

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

  jedis.hset("key".getBytes(), "f22".getBytes(), "v2222".getBytes());

  Pipeline p = jedis.pipelined();
  Response<Map<byte[], byte[]>> fmap = p.hgetAll("key".getBytes());
  Response<Set<byte[]>> fkeys = p.hkeys("key".getBytes());
  Response<List<byte[]>> fordered = p.hmget("key".getBytes(),
    "f22".getBytes(), "f1".getBytes());
  Response<List<byte[]>> fvals = p.hvals("key".getBytes());
  p.sync();

  assertNotNull(fmap.get());
View Full Code Here

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

                Response<List<Object>> exec = p.exec();
                p.sync();
                if (exec.get() == null) {
                    p = jedis.pipelined();
                    p.watch(keys.COUNTS_KEY, keys.BITS_KEY);
                    Response<List<String>> hmget = p.hmget(keys.COUNTS_KEY, hashesString);
                    p.sync();
                    counts = hmget.get().stream().map(Long::valueOf).collect(Collectors.toList());
                } else {
                    return Collections.min(counts);
                }
View Full Code Here

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

                Response<List<Object>> exec = p.exec();
                p.sync();
                if (exec.get() == null) {
                    p = jedis.pipelined();
                    p.watch(keys.COUNTS_KEY, keys.BITS_KEY);
                    Response<List<String>> hmget = p.hmget(keys.COUNTS_KEY, hashesString);
                    p.sync();
                    counts = hmget.get().stream().map(Long::valueOf).collect(Collectors.toList());
                } else {
                    return Collections.min(counts);
                }
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.