tdg5 commented on a change in pull request #34745:
URL: https://github.com/apache/spark/pull/34745#discussion_r758508360



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcConnectionProvider.scala
##########
@@ -53,12 +53,25 @@ abstract class JdbcConnectionProvider {
   def canHandle(driver: Driver, options: Map[String, String]): Boolean
 
   /**
-   * Opens connection toward the database. Since global JVM security 
configuration change may needed
-   * this API is called synchronized by `SecurityConfigurationLock` to avoid 
race.
+   * Opens connection to the database. Since global JVM security configuration 
change may be
+   * needed this API is called synchronized by `SecurityConfigurationLock` to 
avoid race when
+   * `needsModifySecurityConfiguration` returns true for the given driver with 
the given options.
    *
    * @param driver  Java driver which initiates the connection
    * @param options Driver options which initiates the connection
    * @return a `Connection` object that represents a connection to the URL
    */
   def getConnection(driver: Driver, options: Map[String, String]): Connection
+
+  /**
+   * Checks if this connection provider instance needs to modify global 
security configuration to
+   * handle authentication and thus should synchronize access to the security 
configuration while
+   * the given driver is initiating a connection with the given options.
+   *
+   * @param driver  Java driver which initiates the connection
+   * @param options Driver options which initiates the connection
+   * @return True if the connection provider will need to modify the security 
configuration when
+   * initiating a connection with the given driver with the given options.
+   */
+  def needsModifySecurityConfiguration(driver: Driver, options: Map[String, 
String]): Boolean

Review comment:
       I'm open to other naming ideas.




-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to