title: HConnectionManager (Hector) connection state
body: <p>I'm connecting to <a href="http://cassandra.apache.org/" rel="nofollow">Cassandra db</a> via <a href="http://hector-client.github.io/hector/build/html/index.html" rel="nofollow">Hector</a>.</p>
  
  <p>When given a wrong socket (in purpose) the connection fails with the message:</p>
  
  <pre><code>INFO CassandraHostRetryService - Downed Host Retry service started with queue size -1 and retry delay 10s
  ERROR HConnectionManager - Could not start connection pool for host 132.202.35.14(160.202.35.14):9160
  INFO CassandraHostRetryService - Host detected as down was added to retry queue: 132.202.35.14(160.202.35.14):9160
  INFO JmxMonitor - Registering JMX me.prettyprint.cassandra.service_RTBCluster:ServiceType=hector,MonitorType=hector
  </code></pre>
  
  <p>And it keeps on trying with <code>java.net.ConnectException: Connection timed out: connect</code> every few seconds.
  I would like to know if the connection had failed or succeeded since once it succeeds I would like to take some actions.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>CassandraHostConfigurator cassandraHostConfigurator = new CassandraHostConfigurator(this.socket);
  cluster = new ThriftCluster(this.clusterName, cassandraHostConfigurator);
  ConfigurableConsistencyLevel consistencyLevelPolicy = new ConfigurableConsistencyLevel();
  consistencyLevelPolicy.setDefaultReadConsistencyLevel(getConsistencyLevelPolicy());
  keyspace = HFactory.createKeyspace(keyspaceName, cluster, consistencyLevelPolicy);
  fireConnectionEvent(true);
  </code></pre>
  
  <p>As you can see I'm firing a connection event, but I'm getting there anyways - whether connection succeeded or fails and I have no way to distinguish between the two.
  Is there some event I can catch or any other way I can be informed of the connection state?</p>