Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 083B39133 for ; Thu, 1 Dec 2011 00:30:04 +0000 (UTC) Received: (qmail 93909 invoked by uid 500); 1 Dec 2011 00:30:03 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 93878 invoked by uid 500); 1 Dec 2011 00:30:03 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 93870 invoked by uid 99); 1 Dec 2011 00:30:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 00:30:03 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 00:30:01 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E80EDA7CC9 for ; Thu, 1 Dec 2011 00:29:39 +0000 (UTC) Date: Thu, 1 Dec 2011 00:29:39 +0000 (UTC) From: "Eli Collins (Commented) (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <1356306880.28855.1322699379951.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1214768005.23388.1322602899872.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HADOOP-7870) fix SequenceFile#createWriter with boolean createParent arg to respect createParent. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-7870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160508#comment-13160508 ] Eli Collins commented on HADOOP-7870: ------------------------------------- {noformat} [exec] [exec] -1 overall. [exec] [exec] +1 @author. The patch does not contain any @author tags. [exec] [exec] +1 tests included. The patch appears to include 3 new or modified tests. [exec] [exec] +1 javadoc. The javadoc tool did not generate any warning messages. [exec] [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. [exec] [exec] -1 findbugs. The patch appears to introduce 4 new Findbugs (version 1.3.9) warnings. [exec] {noformat} Per HADOOP-7847, the findbugs warnings are not due to this patch. > fix SequenceFile#createWriter with boolean createParent arg to respect createParent. > ------------------------------------------------------------------------------------ > > Key: HADOOP-7870 > URL: https://issues.apache.org/jira/browse/HADOOP-7870 > Project: Hadoop Common > Issue Type: Bug > Affects Versions: 1.0.0 > Reporter: Jonathan Hsieh > Assignee: Jonathan Hsieh > Attachments: hadoop-7870.patch, hadoop-7870.patch > > > After HBASE-6840, one set of calls to createNonRecursive(...) seems fishy - the new boolean createParent variable from the signature isn't used at all. > {code} > + public static Writer > + createWriter(FileSystem fs, Configuration conf, Path name, > + Class keyClass, Class valClass, int bufferSize, > + short replication, long blockSize, boolean createParent, > + CompressionType compressionType, CompressionCodec codec, > + Metadata metadata) throws IOException { > + if ((codec instanceof GzipCodec) && > + !NativeCodeLoader.isNativeCodeLoaded() && > + !ZlibFactory.isNativeZlibLoaded(conf)) { > + throw new IllegalArgumentException("SequenceFile doesn't work with " + > + "GzipCodec without native-hadoop code!"); > + } > + > + switch (compressionType) { > + case NONE: > + return new Writer(conf, > + fs.createNonRecursive(name, true, bufferSize, replication, blockSize, null), > + keyClass, valClass, metadata).ownStream(); > + case RECORD: > + return new RecordCompressWriter(conf, > + fs.createNonRecursive(name, true, bufferSize, replication, blockSize, null), > + keyClass, valClass, codec, metadata).ownStream(); > + case BLOCK: > + return new BlockCompressWriter(conf, > + fs.createNonRecursive(name, true, bufferSize, replication, blockSize, null), > + keyClass, valClass, codec, metadata).ownStream(); > + default: > + return null; > + } > + } > + > {code} > Nicolas Spiegelberg suggests changing it to > {code} > if (createParent) { use fs.create() } > else { use fs.createNonRecursive(); } > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira