<commit_before>package filodb.cassandra

import com.datastax.driver.core._
import com.typesafe.config.Config
import net.ceedubs.ficus.Ficus._
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.{ExecutionContext, Future}

import filodb.core._

trait FiloCassandraConnector {
  private[this] lazy val cluster =
    Cluster.builder().addContactPoints(config.as[Seq[String]]("hosts") :_*)
                 .withPort(config.getInt("port"))
                 .withAuthProvider(authProvider)
                 .withSocketOptions(socketOptions)
                 .withQueryOptions(queryOptions)
                 .build

  // Cassandra config with following keys:  keyspace, hosts, port, username, password
  def config: Config<commit_msg>Add string configuration option to cassandra hosts to be compliant with spark conf<commit_after>package filodb.cassandra

import com.datastax.driver.core._
import com.typesafe.config.Config
import net.ceedubs.ficus.Ficus._
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.{ExecutionContext, Future}
import scala.util.Try

import filodb.core._

trait FiloCassandraConnector {
  private[this] lazy val cluster =
    Cluster.builder()
                 .addContactPoints(
                   Try(config.as[Seq[String]]("hosts")).getOrElse(config.getString("hosts").split(',').toSeq) :_*
                  )
                 .withPort(config.getInt("port"))
                 .withAuthProvider(authProvider)
                 .withSocketOptions(socketOptions)
                 .withQueryOptions(queryOptions)
                 .build

  // Cassandra config with following keys:  keyspace, hosts, port, username, password
  def config: Config
{'fraction_non_alphanumeric': 0.09571344685848503, 'fraction_numerical': 0.0, 'mean_word_length': 3.018867924528302, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5045240', 'n_tokens_mistral': 469, 'n_tokens_neox': 456, 'n_words': 95}