Examples of hset()


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

  public boolean removeSubscription(String meetingId, String subscriptionId){
    boolean unsubscribed = true;
    Jedis jedis = redisPool.getResource();
    try {
      jedis.hset("meeting:" + meetingId + ":subscription:" + subscriptionId, "active", "false")
    } catch (Exception e){
      log.warn("Cannot rmove subscription:" + meetingId, e);
      unsubscribed = false;
    } finally {
      redisPool.returnResource(jedis);
View Full Code Here

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

 
  public boolean removeSubscription(String meetingId, String subscriptionId){
    boolean unsubscribed = true;
    Jedis jedis = redisPool.getResource();
    try {
      jedis.hset("meeting:" + meetingId + ":subscription:" + subscriptionId, "active", "false")
    } catch (Exception e){
      log.warn("Cannot rmove subscription:" + meetingId, e);
      unsubscribed = false;
    } finally {
      redisPool.returnResource(jedis);
View Full Code Here

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

  public boolean removeSubscription(String meetingId, String subscriptionId){
    boolean unsubscribed = true;
    Jedis jedis = redisPool.getResource();
    try {
      jedis.hset("meeting:" + meetingId + ":subscription:" + subscriptionId, "active", "false")
    } catch (Exception e){
      log.warn("Cannot rmove subscription:" + meetingId, e);
      unsubscribed = false;
    } finally {
      redisPool.returnResource(jedis);
View Full Code Here

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

                Jedis jedis = jedisPool.getResource();
                try {
                    for (URL url : new HashSet<URL>(getRegistered())) {
                        if (url.getParameter(Constants.DYNAMIC_KEY, true)) {
                            String key = toCategoryPath(url);
                            if (jedis.hset(key, url.toFullString(), String.valueOf(System.currentTimeMillis() + expirePeriod)) == 1) {
                                jedis.publish(key, Constants.REGISTER);
                            }
                        }
                    }
                    if (admin) {
View Full Code Here

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

        for (Map.Entry<String, JedisPool> entry : jedisPools.entrySet()) {
            JedisPool jedisPool = entry.getValue();
            try {
                Jedis jedis = jedisPool.getResource();
                try {
                    jedis.hset(key, value, expire);
                    jedis.publish(key, Constants.REGISTER);
                    success = true;
                } finally {
                    jedisPool.returnResource(jedis);
                }
View Full Code Here

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

                Jedis jedis = jedisPool.getResource();
                try {
                    for (URL url : new HashSet<URL>(getRegistered())) {
                        if (url.getParameter(Constants.DYNAMIC_KEY, true)) {
                            String key = toCategoryPath(url);
                            if (jedis.hset(key, url.toFullString(), String.valueOf(System.currentTimeMillis() + expirePeriod)) == 1) {
                                jedis.publish(key, Constants.REGISTER);
                            }
                        }
                    }
                    if (admin) {
View Full Code Here

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

        for (Map.Entry<String, JedisPool> entry : jedisPools.entrySet()) {
            JedisPool jedisPool = entry.getValue();
            try {
                Jedis jedis = jedisPool.getResource();
                try {
                    jedis.hset(key, value, expire);
                    jedis.publish(key, Constants.REGISTER);
                    success = true;
                    if (! replicate) {
                      break; //  如果服务器端已同步数据,只需写入单台机器
                    }
View Full Code Here

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

    private void deferExpired() {
        Jedis jedis = jedisPool.getResource();
        try {
            for (String provider : new HashSet<String>(getRegistered())) {
                String key = toProviderPath(URL.valueOf(provider));
                if (jedis.hset(key, provider, String.valueOf(System.currentTimeMillis() + expirePeriod)) == 0) {
                    jedis.publish(key, Constants.REGISTER);
                }
            }
            for (String consumer : new HashSet<String>(getSubscribed().keySet())) {
                URL url = URL.valueOf(consumer);
View Full Code Here

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

            }
            for (String consumer : new HashSet<String>(getSubscribed().keySet())) {
                URL url = URL.valueOf(consumer);
                if (! Constants.ANY_VALUE.equals(url.getServiceInterface())) {
                    String key = toConsumerPath(url);
                    if (jedis.hset(key, consumer, String.valueOf(System.currentTimeMillis() + expirePeriod)) == 0) {
                        jedis.publish(key, Constants.SUBSCRIBE);
                    }
                }
            }
            if (admin) {
View Full Code Here

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

        String key = toProviderPath(url);
        String value = url.toFullString();
        String expire = String.valueOf(System.currentTimeMillis() + expirePeriod);
        Jedis jedis = jedisPool.getResource();
        try {
            jedis.hset(key, value, expire);
            jedis.publish(key, Constants.REGISTER);
        } finally {
            jedisPool.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.