use of com.thinkaurelius.titan.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory in project titan by thinkaurelius.
the class CassandraKiller method waitForClusterSize.
public void waitForClusterSize(int minSize) throws InterruptedException, StorageException {
CTConnectionFactory f = new CTConnectionFactory(new String[] { address }, port, // username, password
null, // username, password
null, GraphDatabaseConfiguration.CONNECTION_TIMEOUT_DEFAULT, AbstractCassandraStoreManager.THRIFT_DEFAULT_FRAME_SIZE);
CTConnection conn = null;
try {
conn = f.makeRawConnection();
CTConnectionFactory.waitForClusterSize(conn.getClient(), minSize);
} catch (TTransportException e) {
throw new TemporaryStorageException(e);
} finally {
if (null != conn)
if (conn.getTransport().isOpen())
conn.getTransport().close();
}
}
Aggregations