Package redis.clients.jedis

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


        HashMap<String, String> hashMap = new HashMap<String, String>();
        hashMap.put("emotion", Integer.toString(emotion.getEmotion()));
        hashMap.put("note", emotion.getNote());
        hashMap.put("day", Long.valueOf(emotion.getCurrentday().getTime()).toString());
        try {
            Long incr = jedis.incr("ids:emotion");
            jedis.hmset("emotion:"+incr, hashMap);
        }catch(Exception e){
            e.printStackTrace();
        } finally {
            emometer.EmoMeter.getPool().returnResource(jedis);
View Full Code Here


  public String storeSubscription(String meetingId, String externalMeetingID, String callbackURL){
    String sid = "";
    Jedis jedis = redisPool.getResource();
    try {
      sid = Long.toString(jedis.incr("meeting:" + meetingId + ":nextSubscription"));

      HashMap<String,String> props = new HashMap<String,String>();
      props.put("subscriptionID", sid);
      props.put("meetingId", meetingId);
      props.put("externalMeetingID", externalMeetingID);
View Full Code Here

 
  public String storeSubscription(String meetingId, String externalMeetingID, String callbackURL){
    String sid = "";
    Jedis jedis = redisPool.getResource();
    try {
      sid = Long.toString(jedis.incr("meeting:" + meetingId + ":nextSubscription"));

      HashMap<String,String> props = new HashMap<String,String>();
      props.put("subscriptionID", sid);
      props.put("meetingId", meetingId);
      props.put("externalMeetingID", externalMeetingID);
View Full Code Here

  public String storeSubscription(String meetingId, String externalMeetingID, String callbackURL){
    String sid = "";
    Jedis jedis = redisPool.getResource();
    try {
      sid = Long.toString(jedis.incr("meeting:" + meetingId + ":nextSubscription"));

      HashMap<String,String> props = new HashMap<String,String>();
      props.put("subscriptionID", sid);
      props.put("meetingId", meetingId);
      props.put("externalMeetingID", externalMeetingID);
View Full Code Here

  */

  public String generatePollID(String meetingID){
    Jedis jedis = (Jedis) jedisPool.getResource();
    String pattern = getPollRedisPattern(meetingID);
    String pollID = Long.toString(jedis.incr(pattern + SEPARATOR + ID_SEED));
    jedisPool.returnResource(jedis);
    return pollID;
  }

  public String generatePollAnswerID(String meetingID){
View Full Code Here

  }

  public String generatePollAnswerID(String meetingID){
    Jedis jedis = jedisPool.getResource();
    String pattern = getPollRedisPattern(meetingID);
    String pollID = Long.toString(jedis.incr(pattern + SEPARATOR + POLL_ANSWER + SEPARATOR + ID_SEED));
    jedisPool.returnResource(jedis);
    return pollID;
  }

  public void storePoll(Poll p){
View Full Code Here

    this.port = port;
  }
 
  public void record(String meetingId, Map<String, String> event) {   
    Jedis jedis = new Jedis(host, port);
    Long msgid = jedis.incr("global:nextRecordedMsgId");
    jedis.hmset("recording:" + meetingId + COLON + msgid, event);
    jedis.rpush("meeting:" + meetingId + COLON + "recordings", msgid.toString());           
  }
}
View Full Code Here

 
  @Override
  public void record(String session, RecordEvent message) {   
    Jedis jedis = redisPool.getResource();
    try {
      Long msgid = jedis.incr("global:nextRecordedMsgId");
      jedis.hmset("recording" + COLON + session + COLON + msgid, message.toMap());
      jedis.rpush("meeting" + COLON + session + COLON + "recordings", msgid.toString());
    } finally {
      redisPool.returnResource(jedis);
    }           
View Full Code Here

    return TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
  }
 
  private void record(String session, RecordEvent message) {
    Jedis jedis = new Jedis(host, port);
    Long msgid = jedis.incr("global:nextRecordedMsgId");
    jedis.hmset("recording" + COLON + session + COLON + msgid, message.toMap());
    jedis.rpush("meeting" + COLON + session + COLON + "recordings", msgid.toString());           
  }
 
  @Override
View Full Code Here

        Long data = null;
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            long begin = System.currentTimeMillis();
            data = jedis.incr(SafeEncoder.encode(key));
            long end = System.currentTimeMillis();
            LOG.info("getValueFromCache spends: " + (end - begin)
                    + " millionseconds.");
        } catch (Exception e) {
            // do jedis.quit() and jedis.disconnect()
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.