Skip to content

Commit 1b2e262

Browse files
committed
SPARKC-641 Move the deprecation checks from the method apply(SparkConf) to the method fromSparkConf(SparkConf)
Benefits: - every method named `fromSparkConf(SparkConf)` (from classes `CassandraConnectorConf`, `ReadConf` and `WriteConf`) homogeneously checks config deprecations - `apply(SparkConf)` is in effect a synonym of `fromSparkConf(SparkConf)` and so can be used interchangeably
1 parent 08bf6eb commit 1b2e262

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

connector/src/main/scala/com/datastax/spark/connector/cql/CassandraConnectorConf.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ object CassandraConnectorConf extends Logging {
355355
}
356356

357357
def apply(conf: SparkConf): CassandraConnectorConf = {
358-
ConfigCheck.checkConfig(conf)
359358
fromSparkConf(conf)
360359
}
361360

@@ -410,6 +409,9 @@ object CassandraConnectorConf extends Logging {
410409
}
411410

412411
def fromSparkConf(conf: SparkConf) = {
412+
413+
ConfigCheck.checkConfig(conf)
414+
413415
val localDC = conf.getOption(LocalDCParam.name)
414416
val keepAlive = conf.getInt(KeepAliveMillisParam.name, KeepAliveMillisParam.default)
415417
val minReconnectionDelay = conf.getInt(MinReconnectionDelayParam.name, MinReconnectionDelayParam.default)

0 commit comments

Comments
 (0)