private static Cassandra.Client getRawClientWithKeyspace(InetSocketAddress addr, CassandraKeyValueServiceConfig config) throws Exception { Client ret = getRawClient(addr, config); try { ret.set_keyspace(config.getKeyspaceOrThrow()); log.debug("Created new client for {}/{}{}{}", SafeArg.of("address", CassandraLogHelper.host(addr)), UnsafeArg.of("keyspace", config.getKeyspaceOrThrow()), SafeArg.of("usingSsl", config.usingSsl() ? " over SSL" : ""), UnsafeArg.of("usernameConfig", config.credentials().isPresent() ? " as user " + config.credentials().get().username() : "")); return ret; } catch (Exception e) { ret.getOutputProtocol().getTransport().close(); throw e; } }
private static Cassandra.Client getRawClientWithKeyspace(InetSocketAddress addr, CassandraKeyValueServiceConfig config) throws Exception { Client ret = getRawClient(addr, config); try { ret.set_keyspace(config.getKeyspaceOrThrow()); log.debug("Created new client for {}/{}{}{}", SafeArg.of("address", CassandraLogHelper.host(addr)), UnsafeArg.of("keyspace", config.getKeyspaceOrThrow()), SafeArg.of("usingSsl", config.usingSsl() ? " over SSL" : ""), UnsafeArg.of("usernameConfig", config.credentials().isPresent() ? " as user " + config.credentials().get().username() : "")); return ret; } catch (Exception e) { ret.getOutputProtocol().getTransport().close(); throw e; } }