@@ -26,6 +26,7 @@ class AbstractJob extends App {
26
26
val sourceTrustStoreType = sc.getConf.get(" spark.migrate.source.trustStore.type" , " JKS" )
27
27
val sourceKeyStorePath = sc.getConf.get(" spark.migrate.source.keyStore.path" , " " )
28
28
val sourceKeyStorePassword = sc.getConf.get(" spark.migrate.source.keyStore.password" , " " )
29
+ val sourceEnabledAlgorithms = sc.getConf.get(" spark.migrate.source.enabledAlgorithms" , " " )
29
30
30
31
val destinationIsAstra = sc.getConf.get(" spark.migrate.destination.isAstra" , " true" )
31
32
val destinationScbPath = sc.getConf.get(" spark.migrate.destination.scb" , " " )
@@ -38,17 +39,18 @@ class AbstractJob extends App {
38
39
val destinationTrustStoreType = sc.getConf.get(" spark.migrate.destination.trustStore.type" , " JKS" )
39
40
val destinationKeyStorePath = sc.getConf.get(" spark.migrate.destination.keyStore.path" , " " )
40
41
val destinationKeyStorePassword = sc.getConf.get(" spark.migrate.destination.keyStore.password" , " " )
42
+ val destinationEnabledAlgorithms = sc.getConf.get(" spark.migrate.destination.enabledAlgorithms" , " " )
41
43
42
44
val minPartition = new BigInteger (sc.getConf.get(" spark.migrate.source.minPartition" ))
43
45
val maxPartition = new BigInteger (sc.getConf.get(" spark.migrate.source.maxPartition" ))
44
46
45
47
val splitSize = sc.getConf.get(" spark.migrate.splitSize" , " 10000" )
46
48
47
49
var sourceConnection = getConnection(true , sourceIsAstra, sourceScbPath, sourceHost, sourceUsername, sourcePassword, sourceReadConsistencyLevel,
48
- sourceTrustStorePath, sourceTrustStorePassword, sourceTrustStoreType, sourceKeyStorePath, sourceKeyStorePassword);
50
+ sourceTrustStorePath, sourceTrustStorePassword, sourceTrustStoreType, sourceKeyStorePath, sourceKeyStorePassword, sourceEnabledAlgorithms );
49
51
50
52
var destinationConnection = getConnection(false , destinationIsAstra, destinationScbPath, destinationHost, destinationUsername, destinationPassword, destinationReadConsistencyLevel,
51
- destinationTrustStorePath, destinationTrustStorePassword, destinationTrustStoreType, destinationKeyStorePath, destinationKeyStorePassword);
53
+ destinationTrustStorePath, destinationTrustStorePassword, destinationTrustStoreType, destinationKeyStorePath, destinationKeyStorePassword, destinationEnabledAlgorithms );
52
54
53
55
protected def exitSpark () = {
54
56
spark.stop()
@@ -57,7 +59,7 @@ class AbstractJob extends App {
57
59
58
60
private def getConnection (isSource : Boolean , isAstra : String , scbPath : String , host : String , username : String , password : String , readConsistencyLevel : String ,
59
61
trustStorePath : String , trustStorePassword : String , trustStoreType : String ,
60
- keyStorePath : String , keyStorePassword : String ): CassandraConnector = {
62
+ keyStorePath : String , keyStorePassword : String , enabledAlgorithms : String ): CassandraConnector = {
61
63
var connType : String = " Source"
62
64
if (! isSource) {
63
65
connType = " Destination"
@@ -74,17 +76,24 @@ class AbstractJob extends App {
74
76
} else if (null != trustStorePath && ! trustStorePath.trim.isEmpty) {
75
77
abstractLogger.info(connType + " : Connected to Cassandra (or DSE) with SSL!" );
76
78
79
+ // Use defaults when not provided
80
+ var enabledAlgorithmsVar = enabledAlgorithms
81
+ if (enabledAlgorithms == null || enabledAlgorithms.trim.isEmpty) {
82
+ enabledAlgorithmsVar = " TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA"
83
+ }
84
+
77
85
return CassandraConnector (sc.getConf
78
86
.set(" spark.cassandra.auth.username" , username)
79
87
.set(" spark.cassandra.auth.password" , password)
80
88
.set(" spark.cassandra.input.consistency.level" , readConsistencyLevel)
81
89
.set(" spark.cassandra.connection.host" , host)
82
90
.set(" spark.cassandra.connection.ssl.enabled" , " true" )
91
+ .set(" spark.cassandra.connection.ssl.enabledAlgorithms" , enabledAlgorithmsVar)
83
92
.set(" spark.cassandra.connection.ssl.trustStore.password" , trustStorePassword)
84
93
.set(" spark.cassandra.connection.ssl.trustStore.path" , trustStorePath)
85
94
.set(" spark.cassandra.connection.ssl.keyStore.password" , keyStorePassword)
86
95
.set(" spark.cassandra.connection.ssl.keyStore.path" , keyStorePath)
87
- .set(" spark.cassandra.connection.ssl.trustStore.type" , trustStoreType)
96
+ .set(" spark.cassandra.connection.ssl.trustStore.type" , trustStoreType)
88
97
.set(" spark.cassandra.connection.ssl.clientAuth.enabled" , " true" )
89
98
)
90
99
} else {
0 commit comments