ClientBuilder.safeBuild(
ClientBuilder
.get()
.hosts("localhost:11211")
.hostConnectionLimit(1)
.codec(new Memcached()));
Client client = Client.newInstance(service);
testClient(client);
// cache client with cluster
CachePoolCluster cluster = CachePoolClusterUtil.newStaticCluster(
ImmutableSet.of(new CacheNode("localhost", 11211, 1)));
ClientBuilder builder = ClientBuilder.get().codec(new Memcached(null));
com.twitter.finagle.memcachedx.Client memcachedClient = KetamaClientBuilder.get()
.cachePoolCluster(cluster)
.clientBuilder(builder)
.build();