private static Collection<InetAddress> resolveHostAddresses(Configuration conf) { Set<InetAddress> addresses = new HashSet<>(); for (String host : ConfigHelper.getOutputInitialAddress(conf).split(",")) { try { addresses.add(InetAddress.getByName(host)); } catch (UnknownHostException e) { throw new RuntimeException(e); } } return addresses; } }
private static Collection<InetAddress> resolveHostAddresses(Configuration conf) { Set<InetAddress> addresses = new HashSet<>(); for (String host : ConfigHelper.getOutputInitialAddress(conf).split(",")) { try { addresses.add(InetAddress.getByName(host)); } catch (UnknownHostException e) { throw new RuntimeException(e); } } return addresses; } }
private static Collection<InetAddress> resolveHostAddresses(Configuration conf) { Set<InetAddress> addresses = new HashSet<>(); for (String host : ConfigHelper.getOutputInitialAddress(conf).split(",")) { try { addresses.add(InetAddress.getByName(host)); } catch (UnknownHostException e) { throw new RuntimeException(e); } } return addresses; } }
protected void checkOutputSpecs(Configuration conf) { if (ConfigHelper.getOutputKeyspace(conf) == null) throw new UnsupportedOperationException("You must set the keyspace with setOutputKeyspace()"); if (ConfigHelper.getOutputPartitioner(conf) == null) throw new UnsupportedOperationException("You must set the output partitioner to the one used by your Cassandra cluster"); if (ConfigHelper.getOutputInitialAddress(conf) == null) throw new UnsupportedOperationException("You must set the initial output address to a Cassandra node"); }
protected void checkOutputSpecs(Configuration conf) { if (ConfigHelper.getOutputKeyspace(conf) == null) throw new UnsupportedOperationException("You must set the keyspace with setOutputKeyspace()"); if (ConfigHelper.getOutputPartitioner(conf) == null) throw new UnsupportedOperationException("You must set the output partitioner to the one used by your Cassandra cluster"); if (ConfigHelper.getOutputInitialAddress(conf) == null) throw new UnsupportedOperationException("You must set the initial output address to a Cassandra node"); }
protected void checkOutputSpecs(Configuration conf) { if (ConfigHelper.getOutputKeyspace(conf) == null) throw new UnsupportedOperationException("You must set the keyspace with setOutputKeyspace()"); if (ConfigHelper.getOutputPartitioner(conf) == null) throw new UnsupportedOperationException("You must set the output partitioner to the one used by your Cassandra cluster"); if (ConfigHelper.getOutputInitialAddress(conf) == null) throw new UnsupportedOperationException("You must set the initial output address to a Cassandra node"); }
protected void checkOutputSpecs(Configuration conf) { if (ConfigHelper.getOutputKeyspace(conf) == null) throw new UnsupportedOperationException("You must set the keyspace with setOutputKeyspace()"); if (ConfigHelper.getOutputPartitioner(conf) == null) throw new UnsupportedOperationException("You must set the output partitioner to the one used by your Cassandra cluster"); if (ConfigHelper.getOutputInitialAddress(conf) == null) throw new UnsupportedOperationException("You must set the initial output address to a Cassandra node"); }
public static Cassandra.Client getClientFromOutputAddressList(Configuration conf) throws IOException { return getClientFromAddressList(conf, ConfigHelper.getOutputInitialAddress(conf).split(","), ConfigHelper.getOutputRpcPort(conf)); }
public static Cassandra.Client getClientFromOutputAddressList(Configuration conf) throws IOException { return getClientFromAddressList(conf, ConfigHelper.getOutputInitialAddress(conf).split(","), ConfigHelper.getOutputRpcPort(conf)); }
public static Cassandra.Client getClientFromOutputAddressList(Configuration conf) throws IOException { return getClientFromAddressList(conf, ConfigHelper.getOutputInitialAddress(conf).split(","), ConfigHelper.getOutputRpcPort(conf)); }
public static Cassandra.Client getClientFromOutputAddressList(Configuration conf) throws IOException { return getClientFromAddressList(conf, ConfigHelper.getOutputInitialAddress(conf).split(","), ConfigHelper.getOutputRpcPort(conf)); }
public ExternalClient(Configuration conf) { super(); this.conf = conf; this.hostlist = ConfigHelper.getOutputInitialAddress(conf); this.rpcPort = ConfigHelper.getOutputRpcPort(conf); this.username = ConfigHelper.getOutputKeyspaceUserName(conf); this.password = ConfigHelper.getOutputKeyspacePassword(conf); }
CqlRecordWriter(Configuration conf) { this.conf = conf; this.queueSize = conf.getInt(CqlOutputFormat.QUEUE_SIZE, 32 * FBUtilities.getAvailableProcessors()); batchThreshold = conf.getLong(CqlOutputFormat.BATCH_THRESHOLD, 32); this.clients = new HashMap<>(); String keyspace = ConfigHelper.getOutputKeyspace(conf); try (Cluster cluster = CqlConfigHelper.getOutputCluster(ConfigHelper.getOutputInitialAddress(conf), conf)) { Metadata metadata = cluster.getMetadata(); ringCache = new NativeRingCache(conf, metadata); TableMetadata tableMetadata = metadata.getKeyspace(Metadata.quote(keyspace)).getTable(ConfigHelper.getOutputColumnFamily(conf)); clusterColumns = tableMetadata.getClusteringColumns(); partitionKeyColumns = tableMetadata.getPartitionKey(); String cqlQuery = CqlConfigHelper.getOutputCql(conf).trim(); if (cqlQuery.toLowerCase(Locale.ENGLISH).startsWith("insert")) throw new UnsupportedOperationException("INSERT with CqlRecordWriter is not supported, please use UPDATE/DELETE statement"); cql = appendKeyWhereClauses(cqlQuery); } catch (Exception e) { throw new RuntimeException(e); } }
CqlRecordWriter(Configuration conf) { this.conf = conf; this.queueSize = conf.getInt(CqlOutputFormat.QUEUE_SIZE, 32 * FBUtilities.getAvailableProcessors()); batchThreshold = conf.getLong(CqlOutputFormat.BATCH_THRESHOLD, 32); this.clients = new HashMap<>(); String keyspace = ConfigHelper.getOutputKeyspace(conf); try (Cluster cluster = CqlConfigHelper.getOutputCluster(ConfigHelper.getOutputInitialAddress(conf), conf)) { Metadata metadata = cluster.getMetadata(); ringCache = new NativeRingCache(conf, metadata); TableMetadata tableMetadata = metadata.getKeyspace(Metadata.quote(keyspace)).getTable(ConfigHelper.getOutputColumnFamily(conf)); clusterColumns = tableMetadata.getClusteringColumns(); partitionKeyColumns = tableMetadata.getPartitionKey(); String cqlQuery = CqlConfigHelper.getOutputCql(conf).trim(); if (cqlQuery.toLowerCase(Locale.ENGLISH).startsWith("insert")) throw new UnsupportedOperationException("INSERT with CqlRecordWriter is not supported, please use UPDATE/DELETE statement"); cql = appendKeyWhereClauses(cqlQuery); } catch (Exception e) { throw new RuntimeException(e); } }
private BulkLoader.ExternalClient getExternalClient(Configuration conf) { Set<InetAddress> hosts = new HashSet<InetAddress>(); String outputAddress = ConfigHelper.getOutputInitialAddress(conf); if (outputAddress == null) outputAddress = "localhost"; String[] nodes = outputAddress.split(","); for (String node : nodes) { try { hosts.add(InetAddress.getByName(node)); } catch (UnknownHostException e) { throw new RuntimeException(e); } } int rpcPort = ConfigHelper.getOutputRpcPort(conf); String username = ConfigHelper.getOutputKeyspaceUserName(conf); String password = ConfigHelper.getOutputKeyspacePassword(conf); ITransportFactory transportFactory = ConfigHelper.getClientTransportFactory(conf); return new BulkLoader.ExternalClient(hosts, rpcPort, username, password, transportFactory, CqlBulkOutputFormat.getStoragePort(conf), CqlBulkOutputFormat.getSSLStoragePort(conf), getServerEncryptOpt(conf)); }
CqlRecordWriter(Configuration conf) { this.conf = conf; this.queueSize = conf.getInt(CqlOutputFormat.QUEUE_SIZE, 32 * FBUtilities.getAvailableProcessors()); batchThreshold = conf.getLong(CqlOutputFormat.BATCH_THRESHOLD, 32); this.clients = new HashMap<>(); String keyspace = ConfigHelper.getOutputKeyspace(conf); try (Cluster cluster = CqlConfigHelper.getOutputCluster(ConfigHelper.getOutputInitialAddress(conf), conf)) { Metadata metadata = cluster.getMetadata(); ringCache = new NativeRingCache(conf, metadata); TableMetadata tableMetadata = metadata.getKeyspace(Metadata.quote(keyspace)).getTable(ConfigHelper.getOutputColumnFamily(conf)); clusterColumns = tableMetadata.getClusteringColumns(); partitionKeyColumns = tableMetadata.getPartitionKey(); String cqlQuery = CqlConfigHelper.getOutputCql(conf).trim(); if (cqlQuery.toLowerCase(Locale.ENGLISH).startsWith("insert")) throw new UnsupportedOperationException("INSERT with CqlRecordWriter is not supported, please use UPDATE/DELETE statement"); cql = appendKeyWhereClauses(cqlQuery); } catch (Exception e) { throw new RuntimeException(e); } }
logger.trace("Error contacting seed list {} {}", ConfigHelper.getOutputInitialAddress(conf), e.getMessage());
logger.trace("Error contacting seed list {} {}", ConfigHelper.getOutputInitialAddress(conf), e.getMessage());
logger.trace("Error contacting seed list {} {}", ConfigHelper.getOutputInitialAddress(conf), e.getMessage());
logger.debug("Error contacting seed list {} {}", ConfigHelper.getOutputInitialAddress(conf), e.getMessage());