[ 
https://issues.apache.org/jira/browse/HADOOP-6752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12866624#action_12866624
 ] 

Vinay Kumar Thota commented on HADOOP-6752:
-------------------------------------------

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.
{noformat}
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}'" };    
{noformat}

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.

{noformat}
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}'" };    
{noformat}

> Remote cluster control functionality needs some JavaDocs improvement
> --------------------------------------------------------------------
>
>                 Key: HADOOP-6752
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6752
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: test
>    Affects Versions: 0.22.0
>            Reporter: Konstantin Boudnik
>            Assignee: Balaji Rajagopalan
>         Attachments: hadoop-6572.patch
>
>
> Herriot has remote cluster control API. The functionality works fairly well, 
> however, JavaDocs are missed here and there. This has to be fixed.

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

Reply via email to