def fromSparkConf()

in connector/src/main/scala/com/datastax/spark/connector/cql/CassandraConnectorConf.scala [429:467]


  def fromSparkConf(conf: SparkConf) = {

    ConfigCheck.checkConfig(conf)

    val localDC = conf.getOption(LocalDCParam.name)
    val keepAlive = conf.getInt(KeepAliveMillisParam.name, KeepAliveMillisParam.default)
    val minReconnectionDelay = conf.getInt(MinReconnectionDelayParam.name, MinReconnectionDelayParam.default)
    val maxReconnectionDelay = conf.getInt(MaxReconnectionDelayParam.name, MaxReconnectionDelayParam.default)
    val localConnections = conf.getOption(LocalConnectionsPerExecutorParam.name).map(_.toInt)
    val remoteConnections = conf.getOption(RemoteConnectionsPerExecutorParam.name).map(_.toInt)
    val queryRetryCount = conf.getInt(QueryRetryParam.name, QueryRetryParam.default)
    val connectTimeout = conf.getInt(ConnectionTimeoutParam.name, ConnectionTimeoutParam.default)
    val readTimeout = conf.getInt(ReadTimeoutParam.name, ReadTimeoutParam.default)
    val quietPeriodBeforeClose = conf.getInt(QuietPeriodBeforeCloseParam.name, QuietPeriodBeforeCloseParam.default)
    val timeoutBeforeClose = conf.getInt(TimeoutBeforeCloseParam.name, TimeoutBeforeCloseParam.default)
    val resolveContactPoints = conf.getBoolean(ResolveContactPoints.name, ResolveContactPoints.default)

    val compression = conf.getOption(CompressionParam.name).getOrElse(CompressionParam.default)

    val connectionFactory = CassandraConnectionFactory.fromSparkConf(conf)

    CassandraConnectorConf(
      contactInfo = getContactInfoFromSparkConf(conf),
      localDC = localDC,
      keepAliveMillis = keepAlive,
      minReconnectionDelayMillis = minReconnectionDelay,
      maxReconnectionDelayMillis = maxReconnectionDelay,
      localConnectionsPerExecutor = localConnections,
      remoteConnectionsPerExecutor = remoteConnections,
      compression = compression,
      queryRetryCount = queryRetryCount,
      connectTimeoutMillis = connectTimeout,
      readTimeoutMillis = readTimeout,
      connectionFactory = connectionFactory,
      quietPeriodBeforeCloseMillis = quietPeriodBeforeClose,
      timeoutBeforeCloseMillis = timeoutBeforeClose,
      resolveContactPoints = resolveContactPoints
    )
  }