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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0-beta, 3.0.0-alpha1
    • Fix Version/s: 2.1.0-beta
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: