@@ -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, sourcePort, 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, destinationPort, destinationUsername, destinationPassword, destinationSSLEnabled ,
17
19
destinationTrustStorePath, destinationTrustStorePassword, destinationTrustStoreType, destinationKeyStorePath, destinationKeyStorePassword, destinationEnabledAlgorithms);
18
20
19
- private def getConnection (isSource : Boolean , scbPath : String , host : String , username : String , password : String ,
20
- trustStorePath : String , trustStorePassword : String , trustStoreType : String ,
21
+ private def getConnection (isSource : Boolean , scbPath : String , host : String , port : String , username : String , password : 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:port " + host + " : " + port );
38
40
39
41
// Use defaults when not provided
40
42
var enabledAlgorithmsVar = enabledAlgorithms
@@ -47,6 +49,7 @@ class AbstractJob extends BaseJob {
47
49
.set(" spark.cassandra.auth.password" , password)
48
50
.set(" spark.cassandra.input.consistency.level" , consistencyLevel)
49
51
.set(" spark.cassandra.connection.host" , host)
52
+ .set(" spark.cassandra.connection.port" , port)
50
53
.set(" spark.cassandra.connection.ssl.enabled" , " true" )
51
54
.set(" spark.cassandra.connection.ssl.enabledAlgorithms" , enabledAlgorithmsVar)
52
55
.set(" spark.cassandra.connection.ssl.trustStore.password" , trustStorePassword)
@@ -57,12 +60,14 @@ class AbstractJob extends BaseJob {
57
60
.set(" spark.cassandra.connection.ssl.clientAuth.enabled" , " true" )
58
61
)
59
62
} else {
60
- abstractLogger.info(connType + " : Connecting to Cassandra (or DSE) host: " + host);
63
+ abstractLogger.info(connType + " : Connecting to Cassandra (or DSE) host:port " + host + " : " + port );
61
64
62
65
return CassandraConnector (config.set(" spark.cassandra.auth.username" , username)
66
+ .set(" spark.cassandra.connection.ssl.enabled" , sslEnabled)
63
67
.set(" spark.cassandra.auth.password" , password)
64
68
.set(" spark.cassandra.input.consistency.level" , consistencyLevel)
65
- .set(" spark.cassandra.connection.host" , host))
69
+ .set(" spark.cassandra.connection.host" , host)
70
+ .set(" spark.cassandra.connection.port" , port))
66
71
}
67
72
68
73
}
0 commit comments