Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 3515 invoked from network); 23 Apr 2009 17:04:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Apr 2009 17:04:54 -0000 Received: (qmail 27630 invoked by uid 500); 23 Apr 2009 17:04:53 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 27550 invoked by uid 500); 23 Apr 2009 17:04:53 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 27470 invoked by uid 99); 23 Apr 2009 17:04:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2009 17:04:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2009 17:04:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 76732234C4B3 for ; Thu, 23 Apr 2009 10:04:30 -0700 (PDT) Message-ID: <2073879412.1240506270484.JavaMail.jira@brutus> Date: Thu, 23 Apr 2009 10:04:30 -0700 (PDT) From: "Shevek (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Commented: (HADOOP-5708) Configuration should provide a way to write only properties that have been set In-Reply-To: <197762440.1240258727532.JavaMail.jira@brutus> 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-5708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702009#action_12702009 ] Shevek commented on HADOOP-5708: -------------------------------- I am working on this ticket. > Configuration should provide a way to write only properties that have been set > ------------------------------------------------------------------------------ > > Key: HADOOP-5708 > URL: https://issues.apache.org/jira/browse/HADOOP-5708 > Project: Hadoop Core > Issue Type: Improvement > Components: conf > Affects Versions: 0.19.1 > Reporter: Topher ZiCornell > Priority: Minor > > The Configuration.write and .writeXml methods always output all properties, whether they came from a default source, a loaded resource file, or an "overlay" set call. There should be a way to write only the properties that were set, leaving out the properties that came from a default source. > Why? Suppose I build a configuration on a machine that is not associated with a grid, write it out to XML, then try to load it on a grid gateway. The configuration would contain all of the defaults picked up from my non-grid machine, and would completely overwrite all the defaults on that grid. > I propose to add methods to write out only the overlay values in Object and XML formats. > I see two options for implementing this: > 1) Either completely new methods could be crafted (writeOverlay(DataOutput) and writeOverlayXml(OutputStream), or > 2) The existing write() and writeXml() methods could be adjusted to take an additional parameter indicating whether the full properties or overlay properties should be written. (Of course, the existing write() and writeXml() methods would remain, defaulting to the current behavior.) > Option 1 has less impact to existing code. Option 2 is a cleaner implementation with less code-duplication involved. I would much prefer to do option 2. > Oh, and in case it's not clear, I'm offering to make this change and submit it. > Thoughts? > . Topher -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.