Return-Path: X-Original-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A40C76E0 for ; Mon, 18 Jul 2011 07:08:51 +0000 (UTC) Received: (qmail 74949 invoked by uid 500); 18 Jul 2011 07:08:42 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 74000 invoked by uid 500); 18 Jul 2011 07:08:28 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 73989 invoked by uid 99); 18 Jul 2011 07:08:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jul 2011 07:08:22 +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; Mon, 18 Jul 2011 07:08:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C458B23888EA; Mon, 18 Jul 2011 07:07:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1147762 - in /hadoop/common/trunk/hdfs: CHANGES.txt src/test/hdfs/org/apache/hadoop/hdfs/TestWriteConfigurationToDFS.java Date: Mon, 18 Jul 2011 07:07:58 -0000 To: hdfs-commits@hadoop.apache.org From: atm@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110718070758.C458B23888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: atm Date: Mon Jul 18 07:07:58 2011 New Revision: 1147762 URL: http://svn.apache.org/viewvc?rev=1147762&view=rev Log: HDFS-2152. TestWriteConfigurationToDFS causing the random failures. (Uma Maheswara Rao G via atm) Modified: hadoop/common/trunk/hdfs/CHANGES.txt hadoop/common/trunk/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestWriteConfigurationToDFS.java Modified: hadoop/common/trunk/hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hdfs/CHANGES.txt?rev=1147762&r1=1147761&r2=1147762&view=diff ============================================================================== --- hadoop/common/trunk/hdfs/CHANGES.txt (original) +++ hadoop/common/trunk/hdfs/CHANGES.txt Mon Jul 18 07:07:58 2011 @@ -840,6 +840,9 @@ Trunk (unreleased changes) HDFS-2120. on reconnect, DN can connect to NN even with different source versions. (John George via atm) + HDFS-2152. TestWriteConfigurationToDFS causing the random failures. (Uma + Maheswara Rao G via atm) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES Modified: hadoop/common/trunk/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestWriteConfigurationToDFS.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestWriteConfigurationToDFS.java?rev=1147762&r1=1147761&r2=1147762&view=diff ============================================================================== --- hadoop/common/trunk/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestWriteConfigurationToDFS.java (original) +++ hadoop/common/trunk/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestWriteConfigurationToDFS.java Mon Jul 18 07:07:58 2011 @@ -20,6 +20,8 @@ package org.apache.hadoop.hdfs; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.io.IOUtils; + import java.io.OutputStream; import org.junit.Test; @@ -35,15 +37,25 @@ public class TestWriteConfigurationToDFS conf.setInt(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, 4096); System.out.println("Setting conf in: " + System.identityHashCode(conf)); MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build(); - FileSystem fs = cluster.getFileSystem(); - Path filePath = new Path("/testWriteConf.xml"); - OutputStream os = fs.create(filePath); - StringBuilder longString = new StringBuilder(); - for (int i = 0; i < 100000; i++) { - longString.append("hello"); - } // 500KB - conf.set("foobar", longString.toString()); - conf.writeXml(os); - os.close(); + FileSystem fs = null; + OutputStream os = null; + try { + fs = cluster.getFileSystem(); + Path filePath = new Path("/testWriteConf.xml"); + os = fs.create(filePath); + StringBuilder longString = new StringBuilder(); + for (int i = 0; i < 100000; i++) { + longString.append("hello"); + } // 500KB + conf.set("foobar", longString.toString()); + conf.writeXml(os); + os.close(); + os = null; + fs.close(); + fs = null; + } finally { + IOUtils.cleanup(null, os, fs); + cluster.shutdown(); + } } } \ No newline at end of file