@@ -9,15 +9,17 @@ class AbstractJob extends BaseJob {
9
9
abstractLogger.info(" PARAM -- Max Partition: " + maxPartition)
10
10
abstractLogger.info(" PARAM -- Split Size: " + splitSize)
11
11
abstractLogger.info(" PARAM -- Coverage Percent: " + coveragePercent)
12
+ abstractLogger.info(" PARAM -- Origin SSL Enabled: {}" , sourceSSLEnabled);
13
+ abstractLogger.info(" PARAM -- Target SSL Enabled: {}" , destinationSSLEnabled);
12
14
13
- var sourceConnection = getConnection(true , sourceScbPath, sourceHost, sourceUsername, sourcePassword,
15
+ var sourceConnection = getConnection(true , sourceScbPath, sourceHost, sourceUsername, sourcePassword, sourceSSLEnabled,
14
16
sourceTrustStorePath, sourceTrustStorePassword, sourceTrustStoreType, sourceKeyStorePath, sourceKeyStorePassword, sourceEnabledAlgorithms);
15
17
16
- var destinationConnection = getConnection(false , destinationScbPath, destinationHost, destinationUsername, destinationPassword,
18
+ var destinationConnection = getConnection(false , destinationScbPath, destinationHost, destinationUsername, destinationPassword, destinationSSLEnabled,
17
19
destinationTrustStorePath, destinationTrustStorePassword, destinationTrustStoreType, destinationKeyStorePath, destinationKeyStorePassword, destinationEnabledAlgorithms);
18
20
19
21
private def getConnection (isSource : Boolean , scbPath : String , host : String , username : String , password : String ,
20
- trustStorePath : String , trustStorePassword : String , trustStoreType : String ,
22
+ sslEnabled : String , trustStorePath : String , trustStorePassword : String , trustStoreType : String ,
21
23
keyStorePath : String , keyStorePassword : String , enabledAlgorithms : String ): CassandraConnector = {
22
24
var connType : String = " Source"
23
25
if (! isSource) {
@@ -34,7 +36,7 @@ class AbstractJob extends BaseJob {
34
36
.set(" spark.cassandra.input.consistency.level" , consistencyLevel)
35
37
.set(" spark.cassandra.connection.config.cloud.path" , scbPath))
36
38
} else if (trustStorePath.nonEmpty) {
37
- abstractLogger.info(connType + " : Connecting to Cassandra (or DSE) with SSL host: " + host);
39
+ abstractLogger.info(connType + " : Connecting (with clientAuth) to Cassandra (or DSE) host: " + host);
38
40
39
41
// Use defaults when not provided
40
42
var enabledAlgorithmsVar = enabledAlgorithms
@@ -60,6 +62,7 @@ class AbstractJob extends BaseJob {
60
62
abstractLogger.info(connType + " : Connecting to Cassandra (or DSE) host: " + host);
61
63
62
64
return CassandraConnector (config.set(" spark.cassandra.auth.username" , username)
65
+ .set(" spark.cassandra.connection.ssl.enabled" , sslEnabled)
63
66
.set(" spark.cassandra.auth.password" , password)
64
67
.set(" spark.cassandra.input.consistency.level" , consistencyLevel)
65
68
.set(" spark.cassandra.connection.host" , host))
0 commit comments