Package net.spy.memcached

Examples of net.spy.memcached.MemcachedClient


        50 * 1024 * 1024 // 50 MB
    );
    // disable compression
    transcoder.setCompressionThreshold(Integer.MAX_VALUE);

    client = new MemcachedClient(
        new ConnectionFactoryBuilder().setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
                                      .setHashAlg(DefaultHashAlgorithm.FNV1A_64_HASH)
                                      .setLocatorType(ConnectionFactoryBuilder.Locator.CONSISTENT)
                                      .setDaemon(true)
                                      .setFailureMode(FailureMode.Retry)
View Full Code Here


      if (memcachedClient != null) {
         log.warn("Service already started");
         return;
      }
      try {
         memcachedClient = new MemcachedClient(new DefaultConnectionFactory() {
            @Override
            public FailureMode getFailureMode() {
               return failureMode;
            }
View Full Code Here

                        new PlainCallbackHandler( username, password )
                    )
                );
            }

            client = new MemcachedClient( builder.build(), AddrUtil.getAddresses( addresses ) );
        }
    }
View Full Code Here

     * machine as your application, for example.
     * @param address where the <i>memcached</i> daemon is running
     * @throws IOException in case of an error
     */
    public MemcachedHttpCacheStorage(final InetSocketAddress address) throws IOException {
        this(new MemcachedClient(address));
    }
View Full Code Here

     * machine as your application, for example.
     * @param address where the <i>memcached</i> daemon is running
     * @throws IOException in case of an error
     */
    public MemcachedHttpCacheStorage(InetSocketAddress address) throws IOException {
        this(new MemcachedClient(address));
    }
View Full Code Here

     * machine as your application, for example.
     * @param address where the <i>memcached</i> daemon is running
     * @throws IOException in case of an error
     */
    public MemcachedHttpCacheStorage(final InetSocketAddress address) throws IOException {
        this(new MemcachedClient(address));
    }
View Full Code Here

    for (String s : servers) {
      index = s.indexOf(":");
      addr.add(new InetSocketAddress(s.substring(0, index), Integer
          .parseInt(s.substring(index + 1))));
    }
    client = new MemcachedClient(addr);
  }
View Full Code Here

            }

            @Provides
            @Singleton
            public MemcachedClient createMemcachedClient() throws IOException {
                return new MemcachedClient(getMemcachedNodes());
            }

            @Provides
            public CASMutator createCASMutator(MemcachedClient memcachedClient) {
                return new CASMutator(memcachedClient, new SerializingTranscoder());
View Full Code Here

  private String hosts = null;
 
  public void afterPropertiesSet() throws Exception {
    System.setProperty("net.spy.log.LoggerImpl", "net.spy.memcached.compat.log.Log4JLogger");
        if(client == null)
          client = new MemcachedClient(AddrUtil.getAddresses(hosts));
  }
View Full Code Here

      shutdown();
    }
    try {
      ConnectionFactory cf = getConnectionFactory();
      if (cf == null) {
        this._client = new MemcachedClient(AddrUtil.getAddresses(_serverString));
      } else {
        this._client = new MemcachedClient(cf, AddrUtil.getAddresses(_serverString));
      }
    } catch (IOException error) {
      throw(new KeyValueStoreClientException(error));
    }
    return true;
View Full Code Here

TOP

Related Classes of net.spy.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.