Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E537BDD95 for ; Wed, 11 Jul 2012 22:29:15 +0000 (UTC) Received: (qmail 47900 invoked by uid 500); 11 Jul 2012 22:29:15 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 47867 invoked by uid 500); 11 Jul 2012 22:29:15 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 47854 invoked by uid 99); 11 Jul 2012 22:29:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jul 2012 22:29:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jul 2012 22:29:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 399DD23888E4; Wed, 11 Jul 2012 22:28:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1360448 - in /hadoop/common/trunk/hadoop-common-project/hadoop-common: CHANGES.txt src/main/java/org/apache/hadoop/fs/HarFileSystem.java Date: Wed, 11 Jul 2012 22:28:55 -0000 To: common-commits@hadoop.apache.org From: eli@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120711222855.399DD23888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: eli Date: Wed Jul 11 22:28:54 2012 New Revision: 1360448 URL: http://svn.apache.org/viewvc?rev=1360448&view=rev Log: HADOOP-8587. HarFileSystem access of harMetaCache isn't threadsafe. Contributed by Eli Collins Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1360448&r1=1360447&r2=1360448&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt (original) +++ hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt Wed Jul 11 22:28:54 2012 @@ -331,6 +331,8 @@ Branch-2 ( Unreleased changes ) HADOOP-3886. Error in javadoc of Reporter, Mapper and Progressable (Jingguo Yao via harsh) + HADOOP-8587. HarFileSystem access of harMetaCache isn't threadsafe. (eli) + BREAKDOWN OF HDFS-3042 SUBTASKS HADOOP-8220. ZKFailoverController doesn't handle failure to become active Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java?rev=1360448&r1=1360447&r2=1360448&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java (original) +++ hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java Wed Jul 11 22:28:54 2012 @@ -24,11 +24,11 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URLDecoder; import java.util.ArrayList; -import java.util.EnumSet; import java.util.List; import java.util.Map; import java.util.TreeMap; import java.util.HashMap; +import java.util.concurrent.ConcurrentHashMap; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.permission.FsPermission; @@ -52,7 +52,8 @@ import org.apache.hadoop.util.Progressab public class HarFileSystem extends FilterFileSystem { public static final int VERSION = 3; - private static final Map harMetaCache = new HashMap(); + private static final Map harMetaCache = + new ConcurrentHashMap(); // uri representation of this Har filesystem private URI uri; @@ -1055,7 +1056,7 @@ public class HarFileSystem extends Filte FileStatus archiveStat = fs.getFileStatus(archiveIndexPath); archiveIndexTimestamp = archiveStat.getModificationTime(); LineReader aLin; - String retStr = null; + // now start reading the real index file for (Store s: stores) { read = 0;