Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0F1AA200B33 for ; Tue, 14 Jun 2016 20:41:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0DC20160A06; Tue, 14 Jun 2016 18:41:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5DBEB160A47 for ; Tue, 14 Jun 2016 20:41:29 +0200 (CEST) Received: (qmail 26493 invoked by uid 500); 14 Jun 2016 18:41:27 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 26198 invoked by uid 99); 14 Jun 2016 18:41:27 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2016 18:41:27 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8B5B02C1F74 for ; Tue, 14 Jun 2016 18:41:27 +0000 (UTC) Date: Tue, 14 Jun 2016 18:41:27 +0000 (UTC) From: "Akira AJISAKA (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MAPREDUCE-6542) HistoryViewer use SimpleDateFormat,But SimpleDateFormat is not threadsafe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 14 Jun 2016 18:41:30 -0000 [ https://issues.apache.org/jira/browse/MAPREDUCE-6542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15330132#comment-15330132 ] Akira AJISAKA commented on MAPREDUCE-6542: ------------------------------------------ In addition, would you fix the checkstyle warning? {{dateFormat}} seems good. > HistoryViewer use SimpleDateFormat,But SimpleDateFormat is not threadsafe > ------------------------------------------------------------------------- > > Key: MAPREDUCE-6542 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-6542 > Project: Hadoop Map/Reduce > Issue Type: Bug > Components: jobhistoryserver > Affects Versions: 2.2.0, 2.7.1 > Environment: CentOS6.5 Hadoop > Reporter: zhangyubiao > Assignee: zhangyubiao > Attachments: MAPREDUCE-6542-v10.patch, MAPREDUCE-6542-v11.patch, MAPREDUCE-6542-v12.patch, MAPREDUCE-6542-v13.patch, MAPREDUCE-6542-v14.patch, MAPREDUCE-6542-v2.patch, MAPREDUCE-6542-v3.patch, MAPREDUCE-6542-v4.patch, MAPREDUCE-6542-v5.patch, MAPREDUCE-6542-v6.patch, MAPREDUCE-6542-v7.patch, MAPREDUCE-6542-v8.patch, MAPREDUCE-6542-v9.patch, MAPREDUCE-6542.patch > > > I use SimpleDateFormat to Parse the JobHistory File before > {code} > 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(); > } > {code} > 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 -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: mapreduce-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: mapreduce-issues-help@hadoop.apache.org