[ 
https://issues.apache.org/jira/browse/TOREE-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15957355#comment-15957355
 ] 

Kun Liu edited comment on TOREE-403 at 4/5/17 8:29 PM:
-------------------------------------------------------

Turns out that all those 3 temp dirs would be created by calling the 
Files.createTempDirectory method in Java, which in my case of RedHat, will 
create any temp dirs under /tmp/ path.

Also, source codes of the 3 random dirs creation:

1) toree-dependency-downloads<RANDOM ID>
https://github.com/apache/incubator-toree/blob/master/kernel-api/src/main/scala/org/apache/toree/dependencies/DependencyDownloader.scala#L137

2) toree_add_deps<RANDOM ID>
https://github.com/apache/incubator-toree/blob/master/kernel/src/main/scala/org/apache/toree/boot/layer/ComponentInitialization.scala#L126

3) toree_add_jars<RANDOM ID>
https://github.com/apache/incubator-toree/blob/master/kernel/src/main/scala/org/apache/toree/magic/builtin/AddJar.scala#L40



was (Author: liukun1016):
Turns out that all those 3 temp dirs would be created by calling the 
Files.createTempDirectory method in Java, which in my case of RedHat, will 
create any temp dirs under /tmp/ path.

Also, source codes of the 3 random dirs creation:

1) toree_add_deps<RANDOM ID>
https://github.com/apache/incubator-toree/blob/master/kernel/src/main/scala/org/apache/toree/boot/layer/ComponentInitialization.scala#L126

2) toree-dependency-downloads<RANDOM ID>
https://github.com/apache/incubator-toree/blob/master/kernel-api/src/main/scala/org/apache/toree/dependencies/DependencyDownloader.scala#L137

3) toree_add_jars<RANDOM ID>
https://github.com/apache/incubator-toree/blob/master/kernel/src/main/scala/org/apache/toree/magic/builtin/AddJar.scala#L40


> Temporary files/directories should be deleted after a kernel shutdown
> ---------------------------------------------------------------------
>
>                 Key: TOREE-403
>                 URL: https://issues.apache.org/jira/browse/TOREE-403
>             Project: TOREE
>          Issue Type: Improvement
>          Components: Kernel
>    Affects Versions: 0.2.0
>            Reporter: Kun Liu
>
> For Scala kernel, there are 3 types of temporary folders that created, by 
> default under /tmp/ dir, that won't be deleted automatically.
> 1) toree_add_deps<RANDOM ID>
> Right after a Scala kernel is opened, saves JARs by addDeps magic
> Note this will be created even before the addDeps is called the first time
>  
> 2) toree-dependency-downloads-<RANDOM ID>
> Also created right after a new Scala kernel is opened
> This implies the num of 1) and 2) dirs are equal
> (BTW, why this folder is needed? As it is always empty in my case)
>  
> 3) toree_add_jars<RANDOM ID>
> After addJar magic is called, the JAR file would be downloaded to this 
> temporary dir
> Should delete them whenever a kernel is shutdown or killed.
> Also, I would recommend 1) putting all temp files/dirs into one to temp dir, 
> so for each kernel, instead of having 3 temp dirs, there would be only 1, 
> e.g.:
> /tmp/toree-<RANDOM ID>/
> /tmp/toree-<RANDOM ID>/toree_add_deps/
> /tmp/toree-<RANDOM ID>/toree-dependency-downloads/
> /tmp/toree-<RANDOM ID>/toree_add_jars/
> and 2) create a utility class to handle the temp dir creation and deletion 
> tasks.
> Thanks Jacob for providing those two ideas.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to