private static Cassandra.Client getClientFromAddressList(Configuration conf, String[] addresses, int port) throws IOException { Cassandra.Client client = null; List<IOException> exceptions = new ArrayList<IOException>(); for (String address : addresses) { try { client = createConnection(conf, address, port); break; } catch (IOException ioe) { exceptions.add(ioe); } } if (client == null) { logger.error("failed to connect to any initial addresses"); for (IOException ioe : exceptions) { logger.error("", ioe); } throw exceptions.get(exceptions.size() - 1); } return client; }
private static Cassandra.Client getClientFromAddressList(Configuration conf, String[] addresses, int port) throws IOException { Cassandra.Client client = null; List<IOException> exceptions = new ArrayList<IOException>(); for (String address : addresses) { try { client = createConnection(conf, address, port); break; } catch (IOException ioe) { exceptions.add(ioe); } } if (client == null) { logger.error("failed to connect to any initial addresses"); for (IOException ioe : exceptions) { logger.error("", ioe); } throw exceptions.get(exceptions.size() - 1); } return client; }
private static Cassandra.Client getClientFromAddressList(Configuration conf, String[] addresses, int port) throws IOException { Cassandra.Client client = null; List<IOException> exceptions = new ArrayList<IOException>(); for (String address : addresses) { try { client = createConnection(conf, address, port); break; } catch (IOException ioe) { exceptions.add(ioe); } } if (client == null) { logger.error("failed to connect to any initial addresses"); for (IOException ioe : exceptions) { logger.error("", ioe); } throw exceptions.get(exceptions.size() - 1); } return client; }
private static Cassandra.Client getClientFromAddressList(Configuration conf, String[] addresses, int port) throws IOException { Cassandra.Client client = null; List<IOException> exceptions = new ArrayList<IOException>(); for (String address : addresses) { try { client = createConnection(conf, address, port); break; } catch (IOException ioe) { exceptions.add(ioe); } } if (client == null) { logger.error("failed to connect to any initial addresses"); for (IOException ioe : exceptions) { logger.error("", ioe); } throw exceptions.get(exceptions.size() - 1); } return client; }
Cassandra.Client client = ConfigHelper.createConnection(conf, host, ConfigHelper.getInputRpcPort(conf)); client.set_keyspace(keyspace);
Cassandra.Client client = ConfigHelper.createConnection(conf, host.getHostAddress(), rpcPort);