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

HistoryViewer uses SimpleDateFormat, but SimpleDateFormat is not threadsafe

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0, 2.7.1
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: jobhistoryserver
    • Labels:
      None
    • Environment:

      CentOS6.5 Hadoop

      Description

      I use SimpleDateFormat to Parse the JobHistory File before

      private static final SimpleDateFormat dateFormat =
          new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
       public static String getJobDetail(JobInfo job) {
              StringBuffer jobDetails = new StringBuffer("");
              SummarizedJob ts = new SummarizedJob(job);
              jobDetails.append(job.getJobId().toString().trim()).append("\t");
              jobDetails.append(job.getUsername()).append("\t");
              jobDetails.append(job.getJobname().replaceAll("\\n", "")).append("\t");
              jobDetails.append(job.getJobQueueName()).append("\t");
              jobDetails.append(job.getPriority()).append("\t");
              jobDetails.append(job.getJobConfPath()).append("\t");
              jobDetails.append(job.getUberized()).append("\t");
              jobDetails.append(dateFormat.format(job.getSubmitTime())).append("\t");
              jobDetails.append(dateFormat.format(job.getLaunchTime())).append("\t");
              jobDetails.append(dateFormat.format(job.getFinishTime())).append("\t");
             return jobDetails.toString();
      }
      

      But I find I query the SubmitTime and LaunchTime in hive and compare JobHistory File time , I find that the submitTime and launchTime was wrong.

      Finally,I change to use the FastDateFormat to parse the time format and the time become right

        Attachments

        1. MAPREDUCE-6542-branch-2.8-v2.patch
          8 kB
          zhangyubiao
        2. MAPREDUCE-6542-branch-2.8-v1.patch
          8 kB
          zhangyubiao
        3. MAPREDUCE-6542-branch-2.8.patch
          10 kB
          zhangyubiao
        4. MAPREDUCE-6542-v16.patch
          9 kB
          zhangyubiao
        5. MAPREDUCE-6542-v15.patch
          9 kB
          zhangyubiao
        6. MAPREDUCE-6542-v14.patch
          15 kB
          zhangyubiao
        7. MAPREDUCE-6542-v13.patch
          15 kB
          zhangyubiao
        8. MAPREDUCE-6542-v12.patch
          10 kB
          zhangyubiao
        9. MAPREDUCE-6542-v11.patch
          10 kB
          zhangyubiao
        10. MAPREDUCE-6542-v10.patch
          8 kB
          zhangyubiao
        11. MAPREDUCE-6542-v9.patch
          8 kB
          zhangyubiao
        12. MAPREDUCE-6542-v8.patch
          7 kB
          zhangyubiao
        13. MAPREDUCE-6542-v7.patch
          7 kB
          zhangyubiao
        14. MAPREDUCE-6542-v6.patch
          7 kB
          zhangyubiao
        15. MAPREDUCE-6542-v5.patch
          6 kB
          zhangyubiao
        16. MAPREDUCE-6542-v4.patch
          4 kB
          zhangyubiao
        17. MAPREDUCE-6542-v3.patch
          4 kB
          zhangyubiao
        18. MAPREDUCE-6542-v2.patch
          8 kB
          zhangyubiao
        19. MAPREDUCE-6542.patch
          1 kB
          zhangyubiao

          Issue Links

            Activity

              People

              • Assignee:
                piaoyu zhang zhangyubiao
                Reporter:
                piaoyu zhang zhangyubiao
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: