lukasz-antoniak commented on code in PR #336:
URL: https://github.com/apache/cassandra-sidecar/pull/336#discussion_r3091375788


##########
integration-framework/src/main/java/org/apache/cassandra/sidecar/testing/TemporaryCqlSessionProvider.java:
##########
@@ -51,80 +55,84 @@ public class TemporaryCqlSessionProvider implements 
CQLSessionProvider
 {
     private static final Logger logger = 
LoggerFactory.getLogger(TemporaryCqlSessionProvider.class);
     private final List<InetSocketAddress> contactPoints;
-    private Session localSession;
-    private final SSLOptions sslOptions;
-    private final NettyOptions nettyOptions;
-    private final ReconnectionPolicy reconnectionPolicy;
+    private final String localDc;
+    private CqlSession localSession;
+    private final MultiplexingNodeStateListener multiplexingNodeStateListener;
+    private final SSLContext sslContext;
 
-    public TemporaryCqlSessionProvider(List<InetSocketAddress> contactPoints, 
NettyOptions options)
+    public TemporaryCqlSessionProvider(List<InetSocketAddress> contactPoints, 
String localDc)
     {
-        this(contactPoints, options, null);
+        this(contactPoints, localDc, null);
     }
 
-    public TemporaryCqlSessionProvider(List<InetSocketAddress> contactPoints, 
NettyOptions options, SSLOptions sslOptions)
+    public TemporaryCqlSessionProvider(List<InetSocketAddress> contactPoints, 
String localDc, SSLContext sslContext)
     {
-        nettyOptions = options;
-        reconnectionPolicy = new ExponentialReconnectionPolicy(100, 1000);
+        this.multiplexingNodeStateListener = new 
MultiplexingNodeStateListener();
         this.contactPoints = contactPoints;
-        this.sslOptions = sslOptions;
+        this.localDc = localDc;
+        this.sslContext = sslContext;
     }
 
     @NotNull
     @Override
-    public synchronized Session get()
+    public synchronized CqlSession get()
     {
         if (localSession != null)
         {
             return localSession;
         }
 
-        Cluster cluster = null;
         try
         {
             logger.info("Connecting to {}", contactPoints);
-            cluster = Cluster.builder()
-                             .addContactPointsWithPorts(contactPoints)
-                             .withReconnectionPolicy(reconnectionPolicy)
-                             .withoutMetrics()
-                             .withSSL(sslOptions)
-                             .withAuthProvider(new 
PlainTextAuthProvider("cassandra", "cassandra"))
-                             // tests can create a lot of these Cluster 
objects, to avoid creating HWTs and
-                             // event thread pools for each we have the 
override
-                             .withNettyOptions(nettyOptions)

Review Comment:
   It is not possible to pass instance of Netty options, which are shared 
across multiple driver instances. Had to remove `SharedExecutorNettyOptions`, 
but tests run fine locally, so not sure if it is still needed.



-- 
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