title: Cassandra - Is there a way to limit number of async queries?
body: <p>I would like to know if there is way to limit the number of queries executed simultaneously by the cassandra java driver ?</p>
  
  <p>Currently, I execute a lot of queries as follows :</p>
  
  <pre><code>... 
  PreparedStatement stmt = session.prepare("SELECT * FROM users WHERE id = ?");
  BoundStatement boundStatement = new BoundStatement(stmt);
  List&lt;ResultSetFuture&gt; futures = Lists.newArrayListWithExpectedSize(list.length);
  
  for(String id : list ) {
       futures.add(session.executeAsync(boundStatement.bind(id)));
  }
  
  for (ListenableFuture&lt;ResultSet&gt; future : futures) {
  ResultSet rs = future.get();
  ... // do some stuff
  }
  </code></pre>
  
  <p>Unfortunately, this may lead to NoHostAvailableException.</p>
  
  <p>Thanks you.</p>