Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-5359

JobHistory should not use File.separator to match timestamp in path

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.0-beta, 3.0.0-alpha1
    • 2.1.0-beta
    • None
    • None
    • Reviewed

    Description

      In HistoryFileManager.getTimestampPartFromPath() method, we use the following regular expression to match the timestamp in a Path object.

      "\\d{4}" + "\\" + File.separator +  "\\d{2}" + "\\" + File.separator + "\\d{2}"
      

      This is incorrect because Path uses backslash even for Windows path while File.separator is platform dependent, and is a forward slash on Windows.

      This leads to failure matching the timestamp on Windows. One consequence is that addDirectoryToSerialNumberIndex() also failed. Later, getFileInfo() will fail if the job info is not in cache or intermediate directory.

      The test case TestJobHistoryParsing.testScanningOldDirs() tests exactly the above scenario and fails on Windows.

      Attachments

        1. MAPREDUCE-5359-trunk.patch
          1 kB
          Chuan Liu
        2. MAPREDUCE-5359-trunk.2.patch
          1 kB
          Chuan Liu

        Issue Links

          Activity

            chuanliu Chuan Liu added a comment -

            Attach a patch. The fix is simply switching to use backslash instead of File.separator.

            chuanliu Chuan Liu added a comment - Attach a patch. The fix is simply switching to use backslash instead of File.separator .
            hadoopqa Hadoop QA added a comment -

            -1 overall. Here are the results of testing the latest attachment
            http://issues.apache.org/jira/secure/attachment/12590000/MAPREDUCE-5359-trunk.patch
            against trunk revision .

            +1 @author. The patch does not contain any @author tags.

            -1 tests included. 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 javac. The applied patch does not increase the total number of javac compiler warnings.

            +1 javadoc. The javadoc tool did not generate any warning messages.

            +1 eclipse:eclipse. The patch built with eclipse:eclipse.

            +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

            +1 release audit. The applied patch does not increase the total number of release audit warnings.

            +1 core tests. The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common.

            +1 contrib tests. The patch passed contrib unit tests.

            Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3807//testReport/
            Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3807//console

            This message is automatically generated.

            hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12590000/MAPREDUCE-5359-trunk.patch against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . 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 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3807//testReport/ Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3807//console This message is automatically generated.
            chuanliu Chuan Liu added a comment -

            Attach a new patch using Path.SEPARATOR instead of hard coded backslash.

            chuanliu Chuan Liu added a comment - Attach a new patch using Path.SEPARATOR instead of hard coded backslash.
            hadoopqa Hadoop QA added a comment -

            -1 overall. Here are the results of testing the latest attachment
            http://issues.apache.org/jira/secure/attachment/12590310/MAPREDUCE-5359-trunk.2.patch
            against trunk revision .

            +1 @author. The patch does not contain any @author tags.

            -1 tests included. 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 javac. The applied patch does not increase the total number of javac compiler warnings.

            +1 javadoc. The javadoc tool did not generate any warning messages.

            +1 eclipse:eclipse. The patch built with eclipse:eclipse.

            +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

            +1 release audit. The applied patch does not increase the total number of release audit warnings.

            +1 core tests. The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common.

            +1 contrib tests. The patch passed contrib unit tests.

            Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3815//testReport/
            Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3815//console

            This message is automatically generated.

            hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12590310/MAPREDUCE-5359-trunk.2.patch against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . 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 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3815//testReport/ Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3815//console This message is automatically generated.
            cnauroth Chris Nauroth added a comment -

            +1 for the patch. I'll commit this.

            cnauroth Chris Nauroth added a comment - +1 for the patch. I'll commit this.
            cnauroth Chris Nauroth added a comment -

            -1 tests included. 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.

            This patch fixes existing tests on Windows, so no new tests are needed.

            cnauroth Chris Nauroth added a comment - -1 tests included. 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. This patch fixes existing tests on Windows, so no new tests are needed.
            hudson Hudson added a comment -

            Integrated in Hadoop-trunk-Commit #4037 (See https://builds.apache.org/job/Hadoop-trunk-Commit/4037/)
            MAPREDUCE-5359. JobHistory should not use File.separator to match timestamp in path. Contributed by Chuan Liu. (Revision 1499153)

            Result = SUCCESS
            cnauroth : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1499153
            Files :

            • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
            • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobHistoryUtils.java
            hudson Hudson added a comment - Integrated in Hadoop-trunk-Commit #4037 (See https://builds.apache.org/job/Hadoop-trunk-Commit/4037/ ) MAPREDUCE-5359 . JobHistory should not use File.separator to match timestamp in path. Contributed by Chuan Liu. (Revision 1499153) Result = SUCCESS cnauroth : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1499153 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobHistoryUtils.java
            cnauroth Chris Nauroth added a comment -

            I committed this to trunk, branch-2, and branch-2.1-beta. Thank you to Chuan for contributing this patch.

            cnauroth Chris Nauroth added a comment - I committed this to trunk, branch-2, and branch-2.1-beta. Thank you to Chuan for contributing this patch.
            hudson Hudson added a comment -

            Integrated in Hadoop-Yarn-trunk #259 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/259/)
            MAPREDUCE-5359. JobHistory should not use File.separator to match timestamp in path. Contributed by Chuan Liu. (Revision 1499153)

            Result = FAILURE
            cnauroth : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1499153
            Files :

            • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
            • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobHistoryUtils.java
            hudson Hudson added a comment - Integrated in Hadoop-Yarn-trunk #259 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/259/ ) MAPREDUCE-5359 . JobHistory should not use File.separator to match timestamp in path. Contributed by Chuan Liu. (Revision 1499153) Result = FAILURE cnauroth : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1499153 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobHistoryUtils.java
            hudson Hudson added a comment -

            Integrated in Hadoop-Hdfs-trunk #1449 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1449/)
            MAPREDUCE-5359. JobHistory should not use File.separator to match timestamp in path. Contributed by Chuan Liu. (Revision 1499153)

            Result = FAILURE
            cnauroth : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1499153
            Files :

            • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
            • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobHistoryUtils.java
            hudson Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #1449 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1449/ ) MAPREDUCE-5359 . JobHistory should not use File.separator to match timestamp in path. Contributed by Chuan Liu. (Revision 1499153) Result = FAILURE cnauroth : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1499153 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobHistoryUtils.java
            hudson Hudson added a comment -

            Integrated in Hadoop-Mapreduce-trunk #1476 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1476/)
            MAPREDUCE-5359. JobHistory should not use File.separator to match timestamp in path. Contributed by Chuan Liu. (Revision 1499153)

            Result = SUCCESS
            cnauroth : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1499153
            Files :

            • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
            • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobHistoryUtils.java
            hudson Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1476 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1476/ ) MAPREDUCE-5359 . JobHistory should not use File.separator to match timestamp in path. Contributed by Chuan Liu. (Revision 1499153) Result = SUCCESS cnauroth : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1499153 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobHistoryUtils.java

            People

              chuanliu Chuan Liu
              chuanliu Chuan Liu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: