Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # user >> Getting a temporary directory in map jobs


Copy link to this message
-
Re: Getting a temporary directory in map jobs
On 12/21/2010 09:50 PM, Chase Bradford wrote:
> If you want a tmp file on a task's local host, just use java's
> createTempFile from the File class.  It creates a file in
> java.io.tmp, which the task runner sets up in the task's workspace
> and is cleaned by the TT even if the child jvm exits badly.

Mostly correct.  But just FYI, the temp file does not automatically get
deleted (see:
http://download.oracle.com/javase/6/docs/api/java/io/File.html#createTempFile%28java.lang.String,%20java.lang.String,%20java.io.File%29)
unless you call deleteOnExit()
(http://download.oracle.com/javase/6/docs/api/java/io/File.html#deleteOnExit%28%29).

DR