-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DriverPath and LoadJDBCJars #89
Comments
I updated the issue and jcommander doesnt solve the issue. But that might be because I was unclear about the issue. |
@npetzall Now Based on my understanding you would like to extend I will try to thnik about this change and maybe we can improve this a little |
Impala wouldn't actually need a loadjars since the jars could have been specified. So having -loadjars which is incompatible with the above seems complex. I'll have another look at it tonight. |
-dpAllows to specify driverjar and additional jars -loadjarsAllow to specify driverjar and it will load all jars in same folder (now it actually loads .?ar(jar,war,nar etc) The proposed solution with a small twist. If -dp element is a directory it will include all .?ar file and even the directory to the classpath of driver loading. So instead of listing jars or even a single jar and adding -loadjars true, it would load them. Everything above would just be: |
@npetzall thank you for detailed explanation and description. I fully agree with you that it will be much easier for SchemaSpy users to have only one parameter -dp and few specyfic option how to load the driver or additional files related to it. I would like to start working on this enhancement after when I will merge changes made by @Riggs333 to the Config class with new JCommander added to the project. |
@rafalkasa this can be done right now, the change is local to DbDriverLoader. You can leave the -loadjars option and it can be removed after his PR. DbDriverLoader will just stop using loadjars flag. |
@rafalkasa Ok if i grab this one? |
Yes sure you can grab this one, I'm more than happy that you have energy and time to working on SchemaSpy |
I haven't verified order since it hasn't been an issue. When the driver is loaded we create a new classloaders if -dp has resulted in existing path(s). I did a quick look in Class.java and sadly it's a native call. But what I've heard about classloading is that it checks the parent first. Child first is normally found in applicationservers like tomcat to avoid static classes to be shared between applications. So there is no requirement to use dp or that it needs to point at a file not on classpaths. This fact is used in the docker image which doesn't use -dp but classpath. So if order is truly important I can verify it. |
-dp takes a string, it can be either a single lib or list of libs separated by File.pathSeparator.
There is an option -loadjars which will load sibling libs, however this only works when -dp is set to a single lib.
I would propose that driver path (-dp) can be used with:
and thus remove the -loadjars option from command-line
A tiny hack would be that -loadjars only operate on the first lib found in -dp
The text was updated successfully, but these errors were encountered: