Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/574#discussion_r82259602
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java
---
@@ -378,38 +399,33 @@ private Path getLocalUdfDir() {
}
/**
- * First tries to get drill conf directory value from system properties,
+ * First tries to get drill temporary directory value from system
properties,
* if value is missing, checks environment properties.
* Throws exception is value is null.
- * @return drill conf dir path
+ * @return drill temporary directory path
*/
- private String getConfDir() {
- String drillConfDir = "DRILL_CONF_DIR";
- String value = System.getProperty(drillConfDir);
+ private String getTmpDir() {
--- End diff --
Can we be more forgiving here?
1. Use DRILL_TMP_DIR, if set.
2. Use a config file setting, if set.
3. Use Google's Files.createTempDir( ) which "Atomically creates a new
directory somewhere beneath the system's temporary directory (as defined by the
java.io.tmpdir system property)"
For most users, the choice in 3 should work fine. It would only be folks
who have special needs that would set one of the other two properties.
Then, we can use a TypeSafe trick to combine 1 and 2. Define the config
property something like this:
drill.temp-dir: "${DRILL_TMP_DIR"
Now, you just have to check drill.temp-dir in your function. If not set,
use the Files approach as a default.
The nice thing about the Files approach is that each Drillbit will have a
different directory (if two happen to be running (with different ports) at the
same time.)
I wonder, however, does the Files temp directory get deleted on Drillbit
exit?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---