Examples of MemcachedClient


Examples of com.danga.MemCached.MemCachedClient

    this.sockIOPool.setMaxIdle( 1000 * 60 * 60 * 6);
    this.sockIOPool.setMaintSleep(30);
    this.sockIOPool.setNagle(false);
    this.sockIOPool.initialize();

    this.memCachedClient = new MemCachedClient();
    this.memCachedClient.setCompressEnable(true);
    this.memCachedClient.setCompressThreshold(0);
  }
View Full Code Here

Examples of com.danga.MemCached.MemCachedClient

            //String[] serverList = servers.split(",?[ *]");
            SockIOPool pool = SockIOPool.getInstance("livePool");
            pool.setServers(serverList);
            pool.initialize();

            cache = new MemCachedClient();
            //cache.setPoolName("livePool");
        }              
    }
View Full Code Here

Examples of com.danga.MemCached.MemCachedClient

        if (cache == null) {
            SockIOPool pool = SockIOPool.getInstance("livePool");
            pool.setServers(servers);
            pool.initialize();
            logger.info("In MemcacheUtility constructor");
            cache = new MemCachedClient();
            //cache.setPoolName("livePool");
        }
    }
View Full Code Here

Examples of com.danga.MemCached.MemCachedClient

            pool.setSocketTO( 3000 );
            pool.setSocketConnectTO( 0 );

            pool.initialize();

            cache = new MemCachedClient();
            MemCachedClient.getLogger().setLevel(Logger.LEVEL_WARN);
           
            // Set thelog level to WARNING -- The defautl is INFO which causes unecessary logging
           
View Full Code Here

Examples of com.danga.MemCached.MemCachedClient

            //String[] serverList = servers.split(",?[ *]");
            SockIOPool pool = SockIOPool.getInstance("livePool");
            pool.setServers(serverList);
            pool.initialize();

            cache = new MemCachedClient();
            //cache.setPoolName("livePool");
        }              
    }
View Full Code Here

Examples of com.danga.MemCached.MemCachedClient

        if (cache == null) {
            SockIOPool pool = SockIOPool.getInstance("livePool");
            pool.setServers(servers);
            pool.initialize();

            cache = new MemCachedClient();
            //cache.setPoolName("livePool");
        }
    }
View Full Code Here

Examples of com.danga.MemCached.MemCachedClient

 
  public MemcachedCache initializeClient(String poolName) {
    MemcachedCache cache = clientPool.get(poolName);
    if(cache == null) {
      //I don't know why binary protocol is invalide in my pc, so just use tcp ascii;
      MemCachedClient client = new MemCachedClient(poolName, true, false);
      cache = new MemcachedCache(client);
    }
    return cache;
  }
View Full Code Here

Examples of com.m3.memcached.facade.MemcachedClient

        CacheResult annotation = getCacheResultAnnotation(invocation);
        if (annotation != null) {
            if (!isPoolInitialized) {
                initializePool();
            }
            MemcachedClient memcached = pool.getClient();
            String cacheKey = annotation.cacheKey().equals("") ? getCacheKey(invocation, isUsingRawKey()) : annotation.cacheKey();
            Object cachedObject = null;
            try {
                cachedObject = memcached.get(cacheKey);
            } catch (Throwable t) {
                if (log.isDebugEnabled()) {
                    log.debug("Failed to get a value from memcached servers. (" + cacheKey + ")", t);
                }
            }
            if (cachedObject != null) {
                return cachedObject;
            } else {
                Object value = invocation.proceed();
                try {
                    memcached.set(cacheKey, annotation.secondsToExpire(), value);
                } catch (Throwable t) {
                    if (log.isDebugEnabled()) {
                        log.debug("Failed to set a value to memcached servers. (" + cacheKey + " -> " + value + ")", t);
                    }
                }
View Full Code Here

Examples of com.meetup.memcached.MemcachedClient

    pool.setMaxIdle(1000 * 60 * 60 * 6);
    pool.setHashingAlg(SockIOPool.NEW_COMPAT_HASH);
    pool.setFailover(true);

    pool.initialize();
    client = new MemcachedClient(poolName);
    client.setPrimitiveAsString(false);
    client.setCompressEnable(true);
    client.setSanitizeKeys(true);
    Logger.getLogger(MemcachedClient.class.getName()).setLevel(Logger.LEVEL_WARN);
  }
View Full Code Here

Examples of net.rubyeye.xmemcached.MemcachedClient

    Assert.assertEquals("hello world", this.memcachedClient
        .get("queue1/open"));
    // close connection
    this.memcachedClient.shutdown();
    // still can fetch it
    MemcachedClient newClient = newBuilder().build();
    newClient.setOptimizeGet(false);
    // begin transaction
    Assert.assertEquals("hello world", newClient.get("queue1/open"));
    // confirm
    Assert.assertNull(newClient.get("queue1/close"));
    Assert.assertNull(newClient.get("queue1"));

    // test abort,for kestrel 1.2
    Assert.assertTrue(newClient.set("queue1", 0, "hello world"));
    Assert.assertEquals("hello world", newClient.get("queue1/open"));
    // abort
    Assert.assertNull(newClient.get("queue1/abort"));
    // still alive
    Assert.assertEquals("hello world", newClient.get("queue1/open"));
    // confirm
    Assert.assertNull(newClient.get("queue1/close"));
    // null
    Assert.assertNull(newClient.get("queue1"));

    newClient.shutdown();
  }
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.