zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Silberstein <a...@trifacta.com>
Subject question about server startup time in testing env
Date Fri, 14 Dec 2012 00:56:35 GMT
I've written a test helper class that starts up ZK in-process and tears it down when done.
 Here's a code snippet:

 static NIOServerCnxnFactory _standaloneServerFactory;
 public static int _clientPort = 21818;
 static ZooKeeperServer _server;
 _server = new ZooKeeperServer(dir, dir, tickTime);
 _standaloneServerFactory = new NIOServerCnxnFactory();
 _standaloneServerFactory.configure(new InetSocketAddress(_clientPort), numConnections);

One thing I've noticed is that the final line appears to be synchronous in nature, whenever
I attempt to connect to ZK immediately, my client fails.  Currently, I just retry a few times.
 Is there a programmatic way to check when the server is read for connections?  I tried a
few method calls on ZooKeeperServer but nothing was helpful there.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message