You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (JIRA)" <ji...@apache.org> on 2016/08/08 17:38:20 UTC

[jira] [Resolved] (PIG-4965) Refactor test/perf/pigmix/bin/runpigmix.pl to delete the output of single test case if we enable cleanup_after_test

     [ https://issues.apache.org/jira/browse/PIG-4965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Dai resolved PIG-4965.
-----------------------------
       Resolution: Fixed
     Hadoop Flags: Reviewed
    Fix Version/s: 0.17.0
                   spark-branch

Patch committed to both trunk and spark-branch. Thanks Liyun!

> 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
>             Fix For: spark-branch, 0.17.0
>
>         Attachments: PIG-4965.patch
>
>
> 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)