code: Connection getConnection(ConnectionPool pool)
      {
          ConnectionPool connectionPool = pool;
          boolean success = false;
          while (!success)
          {
              try
              {
                  success = true;
                  Cassandra.Client client = connectionPool.getConnection();
  
                  if (logger.isDebugEnabled())
                  {
                      logger.debug("Returning connection of {} :{} .", pool.getPoolProperties().getHost(), pool
                              .getPoolProperties().getPort());
                  }
  
                  return new Connection(client, connectionPool);
              }
              catch (TException te)
              {
                  success = false;
                  logger.warn("{} :{}  host appears to be down, trying for next ", pool.getPoolProperties().getHost(),
                          pool.getPoolProperties().getPort());
                  connectionPool = getNewPool(pool.getPoolProperties().getHost(), pool.getPoolProperties().getPort());
              }
          }
  
          throw new KunderaException("All hosts are down. please check servers manully.");
      }
docs: Gets the connection.
  
  @param pool the pool
  @return the connection