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

Prashant Kommireddi commented on PIG-2591:
------------------------------------------

Hi Jarek, just looked at your patch. It would probably good to have a common 
method to access the temp directory. The following code in FileLocalizer.java 
sets default temp dir to "/tmp". You can probably modify this class to make it 
that shared util

{code}
    private static synchronized ContainerDescriptor relativeRoot(final 
PigContext pigContext)
            throws DataStorageException {

        if (relativeRoot.get() == null) {
            String tdir= pigContext.getProperties().getProperty("pig.temp.dir", 
"/tmp");
            relativeRoot.set(pigContext.getDfs().asContainer(tdir + "/temp" + 
r.nextInt()));
            toDelete().push(relativeRoot.get());
        }

        return relativeRoot.get();
    }
{code}

Thanks for working on this.
                
> Unit tests should not write to /tmp but respect java.io.tmpdir
> --------------------------------------------------------------
>
>                 Key: PIG-2591
>                 URL: https://issues.apache.org/jira/browse/PIG-2591
>             Project: Pig
>          Issue Type: Bug
>          Components: tools
>            Reporter: Thomas Weise
>            Assignee: Jarek Jarcec Cecho
>             Fix For: 0.12
>
>         Attachments: PIG-2495.patch
>
>
> Several tests use /tmp but should derive temporary file location from 
> java.io.tmpdir to avoid side effects (java.io.tmpdir is already set to a test 
> run specific location in build.xml)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to