twitter/commons — Issue #6: I use  thrift client ,write a  flockdb client 
Author: hzlinux
Created: 2011-10-18 02:48:39+00:00
State: open

my code
{code}
public class ClientPool {
ThriftFactory f =null;
Thrift t=null;

public ClientPool(String host, int port) {
f =	ThriftFactory.create(FlockDB.Iface.class);
Set backends = new HashSet();
InetSocketAddress ad = new InetSocketAddress(host,port);
backends.add(ad);
f.withMaxConnectionsPerEndpoint(100).useFramedTransport(true).withServiceName("flockdbatbokee");
t = f.build(backends);

}

public FlockDB.Iface create() {

return (FlockDB.Iface) ((ClientBuilder) t.builder().disableStats().withRetries(3)).create();
}

public Object borrowObject() {
return create() ;
}
public void returnObject(Object obj) {
}

public void close() {
if(t!=null) {
t.close();
}
}
}

{code}
When run ;
I see a lot of

Oct 18, 2011 10:39:41 AM com.twitter.common.stats.Stats export
WARNING: Re-using already registered variable for key flockdbatbokee_contains_retries

I use ThriftFactory is right?