You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Konstantin Boudnik (JIRA)" <ji...@apache.org> on 2010/06/04 06:13:57 UTC

[jira] Assigned: (HADOOP-6788) [Herriot] Exception exclusion functionality is not working correctly.

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

Konstantin Boudnik reassigned HADOOP-6788:
------------------------------------------

    Assignee: Vinay Kumar Thota  (was: Balaji Rajagopalan)

> [Herriot] Exception exclusion functionality is not working correctly.
> ---------------------------------------------------------------------
>
>                 Key: HADOOP-6788
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6788
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 0.21.0
>            Reporter: Vinay Kumar Thota
>            Assignee: Vinay Kumar Thota
>             Fix For: 0.21.0
>
>         Attachments: 6788-ydist-security.patch, 6788-ydist-security.patch, HADOOP-6788.patch, HADOOP-6788.patch
>
>
> Exception exclusion functionality is not working correctly because of that tests are failing by not matching the error count.
> I debugged the issue and found that the problem with shell command which is generating in the getNumberOfMatchesInLogFile function.
> Currently building the shell command in the following way. 
> if(list != null){
>   for(int i =0; i < list.length; ++i)
>   {
>     filePattern.append(" | grep -v " + list[i] );
>   }
> }
>     String[] cmd =
>         new String[] {
>             "bash",
>             "-c",
>             "grep -c "
>                 + pattern + " " + filePattern
>                 + " | awk -F: '{s+=$2} END {print s}'" };    
> However, The above commnad won't work correctly because you are counting the exceptions in the file before excluding the known exceptions.
> In this case it gives the mismatch error counts everytime.The shell command should be in the following way to work correctly.
> if (list != null) {
>   int index = 0;
>   for (String excludeExp : list) {
>     filePattern.append((++index < list.length)? "| grep -v " : 
>             "| grep -vc " + list[i] );  
>   }
> }
> String[] cmd =
>    new String[] {
>        "bash",
>        "-c",
>        "grep "
>            + pattern + " " + filePattern
>            + " | awk -F: '{s+=$2} END {print s}'" };  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.