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

Rohini Palaniswamy commented on PIG-3874:
-----------------------------------------

Can you simplify

{code}
String tempPath= FileLocalizer.getTemporaryPath(pigContext).toString();
        Path path = new Path(tempPath);
        URI uri = path.toUri();
        String prefix = "";
        if (uri.getScheme() != null) {
            prefix = uri.getScheme() + ":";
        }
        assertTrue(tempPath.startsWith(prefix + pigTempDir.getPath()));
{code}

to 

{code}
String tempPath= FileLocalizer.getTemporaryPath(pigContext).toString();
Path path = new Path(tempPath);
assertTrue(tempPath.startsWith(pigTempDir.toURI()));
{code}

> FileLocalizer temp path can sometimes be non-unique
> ---------------------------------------------------
>
>                 Key: PIG-3874
>                 URL: https://issues.apache.org/jira/browse/PIG-3874
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.13.0
>            Reporter: Mona Chitnis
>            Assignee: Mona Chitnis
>             Fix For: 0.13.0
>
>         Attachments: PIG-3874-1.patch, PIG-3874.patch
>
>
> In some rare corner cases, more than one process can arrive at the same 
> randomly generated temporary path to localize task files. This needs to be 
> handled with a check to see if location already exists and to get a unique 
> path.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to