Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 14700 invoked from network); 3 Oct 2008 16:39:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Oct 2008 16:39:07 -0000 Received: (qmail 53652 invoked by uid 500); 3 Oct 2008 16:39:05 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 53620 invoked by uid 500); 3 Oct 2008 16:39:05 -0000 Mailing-List: contact core-commits-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-commits@hadoop.apache.org Received: (qmail 53611 invoked by uid 99); 3 Oct 2008 16:39:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Oct 2008 09:39:05 -0700 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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Oct 2008 16:38:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 11F2C238885D; Fri, 3 Oct 2008 09:38:16 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r701436 - in /hadoop/core/trunk: CHANGES.txt src/core/org/apache/hadoop/fs/ChecksumFileSystem.java src/test/org/apache/hadoop/hdfs/TestFSInputChecker.java Date: Fri, 03 Oct 2008 16:38:15 -0000 To: core-commits@hadoop.apache.org From: szetszwo@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081003163816.11F2C238885D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: szetszwo Date: Fri Oct 3 09:38:15 2008 New Revision: 701436 URL: http://svn.apache.org/viewvc?rev=701436&view=rev Log: HADOOP-4326. ChecksumFileSystem does not override create(...) correctly. (szetszwo) Modified: hadoop/core/trunk/CHANGES.txt hadoop/core/trunk/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestFSInputChecker.java Modified: hadoop/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=701436&r1=701435&r2=701436&view=diff ============================================================================== --- hadoop/core/trunk/CHANGES.txt (original) +++ hadoop/core/trunk/CHANGES.txt Fri Oct 3 09:38:15 2008 @@ -1679,6 +1679,9 @@ HADOOP-4318. DistCp should use absolute paths for cleanup. (szetszwo) + HADOOP-4326. ChecksumFileSystem does not override create(...) correctly. + (szetszwo) + Release 0.17.2 - 2008-08-11 BUG FIXES Modified: hadoop/core/trunk/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java?rev=701436&r1=701435&r2=701436&view=diff ============================================================================== --- hadoop/core/trunk/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java (original) +++ hadoop/core/trunk/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java Fri Oct 3 09:38:15 2008 @@ -25,6 +25,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; import org.apache.hadoop.util.StringUtils; @@ -341,28 +342,22 @@ } } - /** - * Opens an FSDataOutputStream at the indicated Path with write-progress - * reporting. - * @param f the file name to open - * @param overwrite if a file with this name already exists, then if true, - * the file will be overwritten, and if false an error will be thrown. - * @param bufferSize the size of the buffer to be used. - * @param replication required block replication for the file. - */ + /** {@inheritDoc} */ @Override - public FSDataOutputStream create(Path f, boolean overwrite, int bufferSize, - short replication, long blockSize, Progressable progress) - throws IOException { + public FSDataOutputStream create(Path f, FsPermission permission, + boolean overwrite, int bufferSize, short replication, long blockSize, + Progressable progress) throws IOException { Path parent = f.getParent(); if (parent != null && !mkdirs(parent)) { throw new IOException("Mkdirs failed to create " + parent); } - return new FSDataOutputStream - (new ChecksumFSOutputSummer - (this, f, overwrite, bufferSize, replication, - blockSize, progress), - null); + final FSDataOutputStream out = new FSDataOutputStream( + new ChecksumFSOutputSummer(this, f, overwrite, bufferSize, replication, + blockSize, progress), null); + if (permission != null) { + setPermission(f, permission); + } + return out; } /** Modified: hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestFSInputChecker.java URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestFSInputChecker.java?rev=701436&r1=701435&r2=701436&view=diff ============================================================================== --- hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestFSInputChecker.java (original) +++ hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestFSInputChecker.java Fri Oct 3 09:38:15 2008 @@ -28,6 +28,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.io.IOUtils; /** @@ -48,9 +49,9 @@ /* create a file */ private void writeFile(FileSystem fileSys, Path name) throws IOException { // create and write a file that contains three blocks of data - FSDataOutputStream stm = fileSys.create(name, true, - fileSys.getConf().getInt("io.file.buffer.size", 4096), - NUM_OF_DATANODES, BLOCK_SIZE); + FSDataOutputStream stm = fileSys.create(name, new FsPermission((short)0777), + true, fileSys.getConf().getInt("io.file.buffer.size", 4096), + (short)NUM_OF_DATANODES, BLOCK_SIZE, null); stm.write(expected); stm.close(); }