pan3793 commented on code in PR #4879:
URL: https://github.com/apache/kyuubi/pull/4879#discussion_r1217920145
##########
kyuubi-common/src/main/scala/org/apache/kyuubi/util/KyuubiHadoopUtils.scala:
##########
@@ -77,8 +75,7 @@ object KyuubiHadoopUtils extends Logging {
* Hadoop 3.2.1.
*/
def getTokenMap(credentials: Credentials): Map[Text, Token[_ <:
TokenIdentifier]] = {
- tokenMapField.get(credentials)
- .asInstanceOf[JMap[Text, Token[_ <: TokenIdentifier]]]
+ getField[JMap[Text, Token[_ <: TokenIdentifier]]](credentials, "tokenMap")
Review Comment:
merge L79-80 into one line?
##########
kyuubi-common/src/main/scala/org/apache/kyuubi/service/authentication/EngineSecuritySecretProvider.scala:
##########
@@ -50,9 +51,9 @@ class SimpleEngineSecuritySecretProviderImpl extends
EngineSecuritySecretProvide
object EngineSecuritySecretProvider {
def create(conf: KyuubiConf): EngineSecuritySecretProvider = {
- val providerClass =
Class.forName(conf.get(ENGINE_SECURITY_SECRET_PROVIDER))
- val provider = providerClass.getConstructor().newInstance()
- .asInstanceOf[EngineSecuritySecretProvider]
+ val provider =
DynConstructors.builder().impl(conf.get(ENGINE_SECURITY_SECRET_PROVIDER))
+ .buildChecked[EngineSecuritySecretProvider]()
+ .newInstance(conf)
Review Comment:
```suggestion
val provider = DynConstructors.builder()
.impl(conf.get(ENGINE_SECURITY_SECRET_PROVIDER))
.buildChecked[EngineSecuritySecretProvider]()
.newInstance(conf)
```
--
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]