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 7F5CE10974 for ; Tue, 3 Mar 2015 09:23:05 +0000 (UTC) Received: (qmail 75293 invoked by uid 500); 3 Mar 2015 09:23:05 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 75241 invoked by uid 500); 3 Mar 2015 09:23:05 -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 75229 invoked by uid 99); 3 Mar 2015 09:23:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 09:23:05 +0000 Date: Tue, 3 Mar 2015 09:23:05 +0000 (UTC) From: "Akira AJISAKA (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-11418) Property "io.compression.codec.lzo.class" does not work with other value besides default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-11418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14344798#comment-14344798 ] Akira AJISAKA commented on HADOOP-11418: ---------------------------------------- Thanks [~fang fang chen] for the report and the patch. Nice catch. The fix looks good to me. Two comments: 1. The code lookups {{conf}} twice. I'm thinking it's better to do in a single lookup as follows: {code} String extClazz = conf.get(CONF_LZO_CLASS); if (extClazz == null) { extClazz = System.getProperty(CONF_LZO_CLASS); } {code} 2. Would you add a regression test for this? I'm thinking the test will * Set "io.compression.codec.lzo.class" to a codec other than the default lzo codec (ex. o.a.h.io.compress.DefaultCodec) * Call {{Algorithm.LZO.isSupported()}} * Call {{Algorithm.LZO.getCodec()}} and verify the specified codec is obtained. > Property "io.compression.codec.lzo.class" does not work with other value besides default > ---------------------------------------------------------------------------------------- > > Key: HADOOP-11418 > URL: https://issues.apache.org/jira/browse/HADOOP-11418 > Project: Hadoop Common > Issue Type: Bug > Components: io > Reporter: fang fang chen > Assignee: fang fang chen > Attachments: HADOOP-11418.patch > > > From following code, seems "io.compression.codec.lzo.class" does not work for other codec besides default. Hadoop will always treat it as defaultClazz. I think it is a bug. Please let me know if this is a work as design thing. Thanks > 77 private static final String defaultClazz = > 78 "org.apache.hadoop.io.compress.LzoCodec"; > 82 public synchronized boolean isSupported() { > 83 if (!checked) { > 84 checked = true; > 85 String extClazz = > 86 (conf.get(CONF_LZO_CLASS) == null ? System > 87 .getProperty(CONF_LZO_CLASS) : null); > 88 String clazz = (extClazz != null) ? extClazz : defaultClazz; -- This message was sent by Atlassian JIRA (v6.3.4#6332)