code: public HThriftClient open() {
      if ( isOpen() ) {
        throw new IllegalStateException("Open called on already open connection. You should not have gotten here.");
      }
      if ( log.isDebugEnabled() ) {
        log.debug("Creating a new thrift connection to {}", cassandraHost);
      }
  
      TSocket socket;    
      try {
          socket = params == null ? 
                                  new TSocket(cassandraHost.getHost(), cassandraHost.getPort(), timeout)
                                  : TSSLTransportFactory.getClientSocket(cassandraHost.getHost(), cassandraHost.getPort(), timeout, params);
      } catch (TTransportException e) {
          throw new HectorTransportException("Could not get client socket: ", e);
      }
      
      if ( cassandraHost.getUseSocketKeepalive() ) {
        try {
          socket.getSocket().setKeepAlive(true);
        } catch (SocketException se) {
          throw new HectorTransportException("Could not set SO_KEEPALIVE on socket: ", se);
        }
      }
  
      transport = maybeWrapWithTFramedTransport(socket);
  
      // If using SSL, the socket will already be connected, and TFramedTransport and
      // TSocket just wind up calling socket.isConnected(), so check this before calling
      // open() to avoid a "Socket already connected" error.
      if (!transport.isOpen()) {
        try {
          transport.open();
        } catch (TTransportException e) {
          // Thrift exceptions aren't very good in reporting, so we have to catch the exception here and
          // add details to it.
          log.debug("Unable to open transport to " + cassandraHost.getName());
          //clientMonitor.incCounter(Counter.CONNECT_ERROR);
          throw new HectorTransportException("Unable to open transport to " + cassandraHost.getName() +" , " +
              e.getLocalizedMessage(), e);
        }
      }
      return this;
    }
docs: {@inheritDoc}