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

    • 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

            People

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

              Dates

                Created:
                Updated:
                Resolved: