Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-13045

hadoop_add_classpath is not working in .hadooprc

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Incompatible change
    • Release Note:
      Hide
      <!-- markdown -->
      With this change, the `.hadooprc` file is now processed after Apache Hadoop has been fully bootstrapped. This allows for usage of the Apache Hadoop Shell API. A new file, `.hadoop-env`, now provides the ability for end users to override `hadoop-env.sh`.
      Show
      <!-- markdown --> With this change, the `.hadooprc` file is now processed after Apache Hadoop has been fully bootstrapped. This allows for usage of the Apache Hadoop Shell API. A new file, `.hadoop-env`, now provides the ability for end users to override `hadoop-env.sh`.

      Description

      hadoop_basic_function resets CLASSPATH after .hadooprc is called.

      $ hadoop --debug version
      (snip)
      DEBUG: Applying the user's .hadooprc
      DEBUG: Initial CLASSPATH=/root/hadoop-tools-0.1-SNAPSHOT.jar
      DEBUG: Initialize CLASSPATH
      DEBUG: Rejected colonpath(JAVA_LIBRARY_PATH): /usr/local/hadoop/build/native
      DEBUG: Rejected colonpath(JAVA_LIBRARY_PATH): /usr/local/hadoop/lib/native
      DEBUG: Initial CLASSPATH=/usr/local/hadoop/share/hadoop/common/lib/*
      
      1. HADOOP-13045.00.patch
        9 kB
        Allen Wittenauer
      2. HADOOP-13045.01.patch
        9 kB
        Allen Wittenauer

        Activity

        Hide
        ajisakaa Akira Ajisaka added a comment -

        My .hadooprc

        #!/usr/bin/env bash
        hadoop_add_classpath /root/hadoop-tools-0.1-SNAPSHOT.jar
        
        Show
        ajisakaa Akira Ajisaka added a comment - My .hadooprc #!/usr/bin/env bash hadoop_add_classpath /root/hadoop-tools-0.1-SNAPSHOT.jar
        Hide
        aw Allen Wittenauer added a comment - - edited

        Correct. .hadooprc is the basic equivalent of the hadoop-env.sh file. To quote the UnixShellGuide.md file:

         This file is always read to initialize and override any variables that the user may want to customize.
        

        There is no mention of the functions working inside of it. None of the _HOME vars are guaranteed to be set either as a result.

        In any case, HADOOP_USER_CLASSPATH should be used to do what you're trying to do.

        Show
        aw Allen Wittenauer added a comment - - edited Correct. .hadooprc is the basic equivalent of the hadoop-env.sh file. To quote the UnixShellGuide.md file: This file is always read to initialize and override any variables that the user may want to customize. There is no mention of the functions working inside of it. None of the _HOME vars are guaranteed to be set either as a result. In any case, HADOOP_USER_CLASSPATH should be used to do what you're trying to do.
        Hide
        aw Allen Wittenauer added a comment -

        Today's shower thought:

        What if we turned the current .hadooprc support into .hadoopenv and add a new .hadooprc hook that gets called after the initialization is done such that functions work?

        Show
        aw Allen Wittenauer added a comment - Today's shower thought: What if we turned the current .hadooprc support into .hadoopenv and add a new .hadooprc hook that gets called after the initialization is done such that functions work?
        Hide
        ajisakaa Akira Ajisaka added a comment -

        Thanks Allen for the comments.

        In any case, HADOOP_USER_CLASSPATH should be used to do what you're trying to do.

        I got it.

        What if we turned the current .hadooprc support into .hadoopenv and add a new .hadooprc hook that gets called after the initialization is done such that functions work?

        I thought that .hadooprc was where to use unix shell API, but it's not. Where can/should we use the API? If there are some places to use the API, I'll use there. I'd like to avoid a new .something, which maybe misunderstanding. If there are no places to use that functions, I'm okay to introduce a new .something.

        Show
        ajisakaa Akira Ajisaka added a comment - Thanks Allen for the comments. In any case, HADOOP_USER_CLASSPATH should be used to do what you're trying to do. I got it. What if we turned the current .hadooprc support into .hadoopenv and add a new .hadooprc hook that gets called after the initialization is done such that functions work? I thought that .hadooprc was where to use unix shell API, but it's not. Where can/should we use the API? If there are some places to use the API, I'll use there. I'd like to avoid a new .something, which maybe misunderstanding. If there are no places to use that functions, I'm okay to introduce a new .something.
        Hide
        aw Allen Wittenauer added a comment -

        Yeah, there really isn't a place. hadooprc was built as a way to override hadoop-env.sh and set things up prior to the bootstrap. But it makes a lot of sense to have something that user's could use to trigger the api. It's a simple change. I'll write it up here in a sec.

        Show
        aw Allen Wittenauer added a comment - Yeah, there really isn't a place. hadooprc was built as a way to override hadoop-env.sh and set things up prior to the bootstrap. But it makes a lot of sense to have something that user's could use to trigger the api. It's a simple change. I'll write it up here in a sec.
        Hide
        ajisakaa Akira Ajisaka added a comment -

        But it makes a lot of sense to have something that user's could use to trigger the api. It's a simple change. I'll write it up here in a sec.

        Agreed. Thanks a lot!

        Show
        ajisakaa Akira Ajisaka added a comment - But it makes a lot of sense to have something that user's could use to trigger the api. It's a simple change. I'll write it up here in a sec. Agreed. Thanks a lot!
        Hide
        aw Allen Wittenauer added a comment -

        -00:

        • quickie patch

        We'll need to go back through the release notes, etc, I think.

        Show
        aw Allen Wittenauer added a comment - -00: quickie patch We'll need to go back through the release notes, etc, I think.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 11s Docker mode activated.
        0 shelldocs 0m 4s Shelldocs was not available.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 mvninstall 6m 41s trunk passed
        +1 mvnsite 0m 55s trunk passed
        +1 mvnsite 0m 53s the patch passed
        +1 shellcheck 0m 9s There were no new shellcheck issues.
        +1 whitespace 0m 0s Patch has no whitespace issues.
        +1 unit 1m 33s hadoop-common in the patch passed with JDK v1.8.0_77.
        +1 unit 1m 34s hadoop-common in the patch passed with JDK v1.7.0_95.
        +1 asflicense 0m 18s Patch does not generate ASF License warnings.
        12m 32s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:fbe3e86
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12800302/HADOOP-13045.00.patch
        JIRA Issue HADOOP-13045
        Optional Tests asflicense mvnsite unit shellcheck shelldocs
        uname Linux ead8053159ee 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 63e5412
        shellcheck v0.4.3
        JDK v1.7.0_95 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9155/testReport/
        modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9155/console
        Powered by Apache Yetus 0.2.0 http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 11s Docker mode activated. 0 shelldocs 0m 4s Shelldocs was not available. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 6m 41s trunk passed +1 mvnsite 0m 55s trunk passed +1 mvnsite 0m 53s the patch passed +1 shellcheck 0m 9s There were no new shellcheck issues. +1 whitespace 0m 0s Patch has no whitespace issues. +1 unit 1m 33s hadoop-common in the patch passed with JDK v1.8.0_77. +1 unit 1m 34s hadoop-common in the patch passed with JDK v1.7.0_95. +1 asflicense 0m 18s Patch does not generate ASF License warnings. 12m 32s Subsystem Report/Notes Docker Image:yetus/hadoop:fbe3e86 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12800302/HADOOP-13045.00.patch JIRA Issue HADOOP-13045 Optional Tests asflicense mvnsite unit shellcheck shelldocs uname Linux ead8053159ee 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 63e5412 shellcheck v0.4.3 JDK v1.7.0_95 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9155/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9155/console Powered by Apache Yetus 0.2.0 http://yetus.apache.org This message was automatically generated.
        Hide
        aw Allen Wittenauer added a comment -

        -01:

        • consistency: .hadoop-env
        • add a unit test
        Show
        aw Allen Wittenauer added a comment - -01: consistency: .hadoop-env add a unit test
        Hide
        hadoopqa Hadoop QA added a comment -
        +1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 10s Docker mode activated.
        0 shelldocs 0m 3s Shelldocs was not available.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
        +1 mvninstall 6m 24s trunk passed
        +1 mvnsite 0m 55s trunk passed
        +1 mvnsite 0m 51s the patch passed
        +1 shellcheck 0m 10s There were no new shellcheck issues.
        +1 whitespace 0m 0s Patch has no whitespace issues.
        +1 unit 1m 37s hadoop-common in the patch passed with JDK v1.8.0_77.
        +1 unit 1m 40s hadoop-common in the patch passed with JDK v1.7.0_95.
        +1 asflicense 0m 17s Patch does not generate ASF License warnings.
        12m 19s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:fbe3e86
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12800382/HADOOP-13045.01.patch
        JIRA Issue HADOOP-13045
        Optional Tests asflicense mvnsite unit shellcheck shelldocs
        uname Linux b1d3e26a77fd 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 6fcde2e
        shellcheck v0.4.3
        JDK v1.7.0_95 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9160/testReport/
        modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9160/console
        Powered by Apache Yetus 0.2.0 http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 reexec 0m 10s Docker mode activated. 0 shelldocs 0m 3s Shelldocs was not available. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 6m 24s trunk passed +1 mvnsite 0m 55s trunk passed +1 mvnsite 0m 51s the patch passed +1 shellcheck 0m 10s There were no new shellcheck issues. +1 whitespace 0m 0s Patch has no whitespace issues. +1 unit 1m 37s hadoop-common in the patch passed with JDK v1.8.0_77. +1 unit 1m 40s hadoop-common in the patch passed with JDK v1.7.0_95. +1 asflicense 0m 17s Patch does not generate ASF License warnings. 12m 19s Subsystem Report/Notes Docker Image:yetus/hadoop:fbe3e86 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12800382/HADOOP-13045.01.patch JIRA Issue HADOOP-13045 Optional Tests asflicense mvnsite unit shellcheck shelldocs uname Linux b1d3e26a77fd 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 6fcde2e shellcheck v0.4.3 JDK v1.7.0_95 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9160/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9160/console Powered by Apache Yetus 0.2.0 http://yetus.apache.org This message was automatically generated.
        Hide
        ajisakaa Akira Ajisaka added a comment -

        +1, thanks Allen. Would you write a release note for this issue?

        Show
        ajisakaa Akira Ajisaka added a comment - +1, thanks Allen. Would you write a release note for this issue?
        Hide
        aw Allen Wittenauer added a comment -

        Thanks for the review. Committed.

        Show
        aw Allen Wittenauer added a comment - Thanks for the review. Committed.
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #9699 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9699/)
        HADOOP-13045. hadoop_add_classpath is not working in .hadooprc (aw: rev 971af603ea2a5c0b5bdb2b79626a204b5dee241e)

        • hadoop-common-project/hadoop-common/src/site/markdown/UnixShellGuide.md
        • hadoop-common-project/hadoop-common/src/test/scripts/hadoop_confdir.bats
        • hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh
        • hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #9699 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9699/ ) HADOOP-13045 . hadoop_add_classpath is not working in .hadooprc (aw: rev 971af603ea2a5c0b5bdb2b79626a204b5dee241e) hadoop-common-project/hadoop-common/src/site/markdown/UnixShellGuide.md hadoop-common-project/hadoop-common/src/test/scripts/hadoop_confdir.bats hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh

          People

          • Assignee:
            aw Allen Wittenauer
            Reporter:
            ajisakaa Akira Ajisaka
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development