Search in sources :

Example 1 with CTConnectionFactory

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();
    }
}
Also used : CTConnection(com.thinkaurelius.titan.diskstorage.cassandra.thrift.thriftpool.CTConnection) TemporaryStorageException(com.thinkaurelius.titan.diskstorage.TemporaryStorageException) TTransportException(org.apache.thrift.transport.TTransportException) CTConnectionFactory(com.thinkaurelius.titan.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory)

Aggregations

TemporaryStorageException (com.thinkaurelius.titan.diskstorage.TemporaryStorageException)1 CTConnection (com.thinkaurelius.titan.diskstorage.cassandra.thrift.thriftpool.CTConnection)1 CTConnectionFactory (com.thinkaurelius.titan.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory)1 TTransportException (org.apache.thrift.transport.TTransportException)1