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

Daniel Dai commented on PIG-4965:
---------------------------------

Remove a file does not exist clearly a bug. I think you can just add 
$pigmixoutput prefix to each file intend to remove.

> Refactor test/perf/pigmix/bin/runpigmix.pl to delete the output of single 
> test case if we enable cleanup_after_test
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-4965
>                 URL: https://issues.apache.org/jira/browse/PIG-4965
>             Project: Pig
>          Issue Type: Bug
>            Reporter: liyunzhang_intel
>            Assignee: liyunzhang_intel
>
> in  test/perf/pigmix/bin/runpigmix.pl#cleanup
> {code}
> sub cleanup {
>     my $suffix = shift;
>     my $cmd;
>     $cmd = "$pigbin -e rmf L".$suffix."out";
>     print STDERR `$cmd 2>&1`;
>     $cmd = "$pigbin -e rmf highest_value_page_per_user";
>     print STDERR `$cmd 2>&1`;
>     $cmd = "$pigbin -e rmf total_timespent_per_term";
>     print STDERR `$cmd 2>&1`;
>     $cmd = "$pigbin -e rmf queries_per_action";
>     print STDERR `$cmd 2>&1`;
>     $cmd = "$pigbin -e rmf tmp";
>     print STDERR `$cmd 2>&1`;
>     if ($cleanup_after_test) {
>         $cmd = "$hadoopbin fs -rmr $pigmixoutput";
>         print STDERR `$cmd 2>&1`;
>     }   
> }
> {code}
> In PIG-200, it deletes the output of the single script. But the output of a 
> single script is not 
> [L.$suffix.out|https://github.com/apache/pig/blob/spark/test/perf/pigmix/bin/runpigmix.pl#L113]
>  so the output is not deleted. The correct output of a single script is 
> PIGMIX_OUTPUT/L.$suffix.out. In PIG-4753(Pigmix should have option to delete 
> outputs after completing the tests), we can delete the output if we enable 
> cleanup_after_test.  So i think we can refactor the code as following:
> {code}
> sub cleanup {
>     if ($cleanup_after_test) {
>         my $suffix = shift;
>         my $cmd;
>         $cmd = "$pigbin -e rmf $pigmixoutput/L".$suffix."out";
>         print STDERR `$cmd 2>&1`;
>         $cmd = "$pigbin -e rmf $pigmixoutput/highest_value_page_per_user";
>         print STDERR `$cmd 2>&1`;
>         $cmd = "$pigbin -e rmf $pigmixoutput/total_timespent_per_term";
>         print STDERR `$cmd 2>&1`;
>         $cmd = "$pigbin -e rmf $pigmixoutput/queries_per_action";
>         print STDERR `$cmd 2>&1`;
>         $cmd = "$pigbin -e rmf tmp";
>         print STDERR `$cmd 2>&1`;
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to