Package com.danga.MemCached

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


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

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

        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

            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

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

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

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

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

 
  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

    pool.setMaxConn(maxConn);
    pool.setMaxIdle(60 * 60 * 1000);
    pool.setServers(servers.split(" "));
    pool.initialize();

    MemCachedClient memcachedClient = new MemCachedClient();
    memcachedClient.setCompressThreshold(16 * 1024);
    System.out.println("Java-MemCached startup");
    warmUp(memcachedClient);

    for (int i = 0; i < THREADS.length; i++) {
      for (int j = 0; j < BYTES.length; j++) {
View Full Code Here

  public boolean exist(String root) {
    return client.keyExists(root);
  }

  public void afterPropertiesSet() throws Exception {
    client = new MemCachedClient();
    // grab an instance of our connection pool
    SockIOPool pool = SockIOPool.getInstance();

    // set the servers and the weights
    pool.setServers(servers);
View Full Code Here

      pool.initialize();
    }

    @Override
    public void configure(Binder binder) {
      binder.bind(MemCachedClient.class).toInstance(new MemCachedClient(true));
      binder.bind(Schema.class).toInstance(User.SCHEMA$);
      binder.bind(String.class).annotatedWith(Names.named("schema")).toInstance("test_schema");
      binder.bind(String.class).annotatedWith(Names.named("table")).toInstance("test_user");
      binder.bind(String.class).annotatedWith(Names.named("family")).toInstance("profile");
    }
View Full Code Here

TOP

Related Classes of com.danga.MemCached.MemCachedClient

Copyright © 2018 www.massapicom. 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.