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

liyunzhang_intel commented on PIG-4965:
---------------------------------------

[~daijy]:  In PIG-200, we really want to delete output 
$pigmixoutput/L.$suffix.out?  If it is, i think we need not add 
cleanup_after_test option(PIG-4753: Pigmix should have option to delete outputs 
after completing the tests). If we still want users to view the output, we need 
retain output($pigmixoutput/L.$suffix.out),  so i think we can delete the 
output $pigmixoutput/L.$suffix.out only when "cleanup_after_test" is enabled 
like following, if you think the following code is ok, i will upload the patch.
{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}


> 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