private boolean verifyConnection(CassandraHost cassandraHost) { if ( cassandraHost == null ) { return false; } boolean found = false; HClient client = clientFactory.createClient(cassandraHost); try { client.open(); found = client.getCassandra().describe_cluster_name() != null; client.close(); } catch (HectorTransportException he) { log.warn("Downed {} host still appears to be down: {}", cassandraHost, he.getMessage()); } catch (Throwable t) { log.error("Downed Host retry failed attempt to verify CassandraHost", t); } return found; } }
private void executeDescribeCluster() { if (!CliMain.isConnected()) return; sessionState.out.println("Cluster Information:"); try { sessionState.out.println(" Name: " + thriftClient.describe_cluster_name()); sessionState.out.println(" Snitch: " + thriftClient.describe_snitch()); sessionState.out.println(" Partitioner: " + thriftClient.describe_partitioner()); sessionState.out.println(" Schema versions: "); Map<String,List<String>> versions = thriftClient.describe_schema_versions(); for (String version : versions.keySet()) { sessionState.out.println(String.format("\t%s: %s%n", version, versions.get(version))); } } catch (Exception e) { String message = (e instanceof InvalidRequestException) ? ((InvalidRequestException) e).getWhy() : e.getMessage(); sessionState.err.println("Error retrieving data: " + message); } }
private void executeShowClusterName() throws TException { if (!CliMain.isConnected()) return; sessionState.out.println(thriftClient.describe_cluster_name()); }
clusterName = thriftClient.describe_cluster_name();
socket.open(); cluster = client.describe_cluster_name();
String cluster_name = connection.describe_cluster_name(); if(log.isTraceEnabled()) { log.trace("[" + parent.getName() + "] Validated connection "+this.toString()+", cluster name = "+cluster_name);
private void waitForCassandra() { LOG.info("Waiting for Cassandra to start"); for (Instance instance : cluster.getInstances()) { int tries = 0; while (tries < 30) { try { Cassandra.Client client = client(instance); client.describe_cluster_name(); client.getOutputProtocol().getTransport().close(); LOG.info(instance.getPublicIp() + " is up and running"); break; } catch (TException e) { try { LOG.warn(instance.getPublicIp() + " not reachable, try #" + tries + ", waiting 1s"); Thread.sleep(10000); } catch (InterruptedException e1) { break; } tries += 1; } } if (tries == 10) { LOG.error("Instance " + instance.getPublicIp() + " is still unavailable after 10 retries"); } } }
private boolean verifyConnection(CassandraHost cassandraHost) { if ( cassandraHost == null ) { return false; } boolean found = false; HClient client = clientFactory.createClient(cassandraHost); try { client.open(); found = client.getCassandra().describe_cluster_name() != null; client.close(); } catch (HectorTransportException he) { log.warn("Downed {} host still appears to be down: {}", cassandraHost, he.getMessage()); } catch (Throwable t) { log.error("Downed Host retry failed attempt to verify CassandraHost", t); } return found; } }
private boolean verifyConnection(CassandraHost cassandraHost) { if ( cassandraHost == null ) { return false; } boolean found = false; HClient client = clientFactory.createClient(cassandraHost); try { client.open(); found = client.getCassandra().describe_cluster_name() != null; client.close(); } catch (HectorTransportException he) { log.warn("Downed {} host still appears to be down: {}", cassandraHost, he.getMessage()); } catch (Throwable t) { log.error("Downed Host retry failed attempt to verify CassandraHost", t); } return found; } }
@Override public String describe_cluster_name() throws TException { return client.describe_cluster_name(); }
@Override public String internalExecute(Client client, ConnectionContext context) throws Exception { return client.describe_cluster_name(); }
@Override public String describe_cluster_name() throws TException { return client.describe_cluster_name(); }
@Override public String internalExecute(Client client, ConnectionContext context) throws Exception { return client.describe_cluster_name(); }
@Override public String execute(Cassandra.Client cassandra) throws HectorException { try { return cassandra.describe_cluster_name(); } catch (Exception e) { throw xtrans.translate(e); } } };
@Override public String execute(Cassandra.Client cassandra) throws HectorException { try { return cassandra.describe_cluster_name(); } catch (Exception e) { throw xtrans.translate(e); } } };
@Override public String describe_cluster_name() throws TException { return client.describe_cluster_name(); }
@Override public String execute(Cassandra.Client cassandra) throws HectorException { try { return cassandra.describe_cluster_name(); } catch (Exception e) { throw xtrans.translate(e); } } };