Package redis.clients.jedis

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


    }

    // Redis List Operations
    public Long rpush(String string) {
        Jedis jedis = getResource();
        Long rpush = jedis.rpush(key(), string);
        returnResource(jedis);
        return rpush;
    }

    public String lset(int index, String value) {
View Full Code Here


        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();

            long begin = System.currentTimeMillis();
            jedis.rpush(SafeEncoder.encode(key), jsonSerialize(value));
            long end = System.currentTimeMillis();
            LOG.info("rpush key:" + key + " spends: " + (end - begin)
                    + " millionseconds.");
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
View Full Code Here

  @Override
  protected void append(ILoggingEvent event) {
    Jedis client = pool.getResource();
    try {
      String json = layout.doLayout(event);
      client.rpush(key, json);
    } catch (Exception e) {
      e.printStackTrace();
      pool.returnBrokenResource(client);
      client = null;
    } finally {
View Full Code Here

  @Override
  public void rpush(String key, String value) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      jedis.rpush(key, value);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

  @Override
  public void rpush(String key, String value) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      jedis.rpush(key, value);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

    @Override
    protected void pushWhenNoDuplicate(Request request, Task task) {
        Jedis jedis = pool.getResource();
        try {
            jedis.rpush(getQueueKey(task), request.getUrl());
            if (request.getExtras() != null) {
                String field = DigestUtils.shaHex(request.getUrl());
                String value = JSON.toJSONString(request);
                jedis.hset((ITEM_PREFIX + task.getUUID()), field, value);
            }
View Full Code Here

        final Jedis jedis = TestUtils.createJedis(config);

        // Submit a job containing incorrect JSON.
        String incorrectJson = "{";
        jedis.sadd(JesqueUtils.createKey(config.getNamespace(), QUEUES), queue);
        jedis.rpush(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue), incorrectJson);

        final Worker worker = new WorkerImpl(config, Arrays.asList(queue),
                new MapBasedJobFactory(JesqueUtils.map(JesqueUtils.entry("SleepAction", SleepAction.class))));
        final Thread workerThread = new Thread(worker);
        workerThread.start();
View Full Code Here

      public void run() {
        Jedis jedis = redisPool.getResource();
        try {
          String key = "bbb:recording:" + message.getMeetingID();
          Gson gson= new Gson();    
          jedis.rpush(key, gson.toJson(message.toMap()));
        } finally {
          redisPool.returnResource(jedis);
        }       
      }
    };
View Full Code Here

      props.put("externalMeetingID", externalMeetingID);
      props.put("callbackURL", callbackURL);
      props.put("active", "true");

      jedis.hmset("meeting:" + meetingId + ":subscription:" + sid, props);
      jedis.rpush("meeting:" + meetingId + ":subscriptions", sid);
     
    } catch (Exception e){
      log.warn("Cannot store subscription:" + meetingId, e);
    } finally {
      redisPool.returnResource(jedis);
View Full Code Here

      props.put("externalMeetingID", externalMeetingID);
      props.put("callbackURL", callbackURL);
      props.put("active", "true");

      jedis.hmset("meeting:" + meetingId + ":subscription:" + sid, props);
      jedis.rpush("meeting:" + meetingId + ":subscriptions", sid);
     
    } catch (Exception e){
      log.warn("Cannot store subscription:" + meetingId, e);
    } finally {
      redisPool.returnResource(jedis);
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.