yifan-c commented on code in PR #169:
URL: 
https://github.com/apache/cassandra-analytics/pull/169#discussion_r3476307790


##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/AbstractBulkWriterContext.java:
##########
@@ -98,10 +101,32 @@ protected AbstractBulkWriterContext(@NotNull BulkSparkConf 
conf,
         this.conf = conf;
         this.sparkDefaultParallelism = sparkDefaultParallelism;
 
-        // Build everything fresh on driver
-        this.clusterInfo = buildClusterInfo();
+        // Retrieve lowest Cassandra version without building full ClusterInfo
+        String lowestCassandraVersion = getLowestCassandraVersion(conf);
+        Set<String> sstableVersionsOnCluster = null;
+
+        // Get SSTable versions from cluster only if SSTable version-based 
selection is enabled
+        // If disabled, skip retrieval to allow job to proceed even when 
SSTable version detection fails
+        if (!conf.isSSTableVersionBasedBridgeDisabled())
+        {
+            sstableVersionsOnCluster = getSSTableVersionsOnCluster(conf);
+        }
+
+        // Determine bridge version
+        this.bridgeVersion = 
SSTableVersionAnalyzer.determineBridgeVersionForWrite(
+            sstableVersionsOnCluster,
+            CassandraVersion.configuredSSTableFormat(),
+            lowestCassandraVersion,
+            conf.isSSTableVersionBasedBridgeDisabled()
+        );
+
+        // Validate that Kryo registrator exists for this bridge version
+        KryoRegister.validateKryoRegistratorExists(this.bridgeVersion, 
lowestCassandraVersion);

Review Comment:
   Please remove the unnecessary code. In general, less lines of code the 
better. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to