You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Statement
The bootstrap of the API is unnecessarily slow due to the instantiation in DatabricksConfig of the DefaultCredentialsProvider in line 18:
private CredentialsProvider credentialsProvider = new DefaultCredentialsProvider();
The DefaultCredentialsProvider instantiates all 11 available CredentialsProvider implementation triggering a lot of class loading and objects instantiation.
The DatabricksConfig object has a setter for the CredentialsProvider, so user of the API can choose and set his/her provider, but even if that case the DefaultCredentialsProvider will be instantiated as part of the field initialization.
Proposed Solution
Only create an instance of DefaultCredentialsProvider inside the authenticate method if the credentalasProvider field has not been set.
Alternatively, inside the DefaultCredentailsProvider, the different providerClasses could be instantiated lazily instead of inside the constructor.
The text was updated successfully, but these errors were encountered:
Problem Statement
The bootstrap of the API is unnecessarily slow due to the instantiation in
DatabricksConfig
of theDefaultCredentialsProvider
in line 18:The
DefaultCredentialsProvider
instantiates all 11 availableCredentialsProvider
implementation triggering a lot of class loading and objects instantiation.The
DatabricksConfig
object has a setter for theCredentialsProvider
, so user of the API can choose and set his/her provider, but even if that case theDefaultCredentialsProvider
will be instantiated as part of the field initialization.Proposed Solution
Only create an instance of
DefaultCredentialsProvider
inside theauthenticate
method if thecredentalasProvider
field has not been set.Alternatively, inside the
DefaultCredentailsProvider
, the differentproviderClasses
could be instantiated lazily instead of inside the constructor.The text was updated successfully, but these errors were encountered: