You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by "li xiang (JIRA)" <ji...@apache.org> on 2014/07/29 09:08:38 UTC

[jira] [Comment Edited] (FLUME-1920) Test case TestFileChannel fails when flume is built from paths containing the string "hadoop"

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

li xiang edited comment on FLUME-1920 at 7/29/14 7:07 AM:
----------------------------------------------------------

Some analysis:

1. In flume-ng-tests/src/test/java/org/apache/flume/test/agent/TestFileChannel.java
    findHadoopJar() is to locate the path of hadoop jar. Aline's fix is to correct an error in this function
    This path is used by class StagedInstall, to add "--classpath hadoop_jar_path" when run "flume-ng"

2. In flume-ng-tests/src/test/java/org/apache/flume/test/util/StagedInstall.java
    A private member "agentClasspath" is set by setAgentClasspath(). 
    And then in startAgent(), if agentClasspath is not null, "--classpath hadoop_jar_path" will be appended when run "flume-ng"

    


was (Author: water):
Some analysis:

1. In flume\flume-ng-tests\src\test\java\org\apache\flume\test\agent\TestFileChannel.java
    findHadoopJar() is to locate the path of hadoop jar. Aline's fix is to correct an error in this function
    This path is used by class StagedInstall, to add "--classpath hadoop_jar_path" when run "flume-ng"

2. In flume\flume-ng-tests\src\test\java\org\apache\flume\test\util\StagedInstall.java
    A private member "agentClasspath" is set by setAgentClasspath(). 
    And then in startAgent(), if agentClasspath is not null, "--classpath hadoop_jar_path" will be appended when run "flume-ng"

    

> Test case TestFileChannel fails when flume is built from paths containing the string "hadoop"
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLUME-1920
>                 URL: https://issues.apache.org/jira/browse/FLUME-1920
>             Project: Flume
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: v1.3.0, v1.4.0, v1.3.1, v1.5.0, v1.6.0
>            Reporter: Aline Guedes Pinto
>            Assignee: Aline Guedes Pinto
>            Priority: Minor
>         Attachments: FLUME-1920-1.patch, FLUME-1920.patch
>
>
> When flume is built from a path that contains the string "hadoop" (ie: /home/user/hadoop_components/flume), the test case TestFileChannel fails.
> The reason it fails is because it can't find the correct location of the hadoop jar file - the function findHadoopJar in TestFileChannel.java 
> looks for the hadoop jar path by searching for the string "hadoop" in the property java.class.path, and returns the first match of the search. 
> This is not necessarily the correct location of the hadoop jar.
> The right thing to do is to look for the name of the hadoop jar in the classpath (ie: hadoop-core-1.1.1.jar), instead of looking for the string "hadoop".



--
This message was sent by Atlassian JIRA
(v6.2#6252)