Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 09E2190BF for ; Fri, 25 May 2012 04:12:41 +0000 (UTC) Received: (qmail 40958 invoked by uid 500); 25 May 2012 04:12:40 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 40898 invoked by uid 500); 25 May 2012 04:12:40 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 40699 invoked by uid 99); 25 May 2012 04:12:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 May 2012 04:12:40 +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; Fri, 25 May 2012 04:12:36 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 30FE02388865; Fri, 25 May 2012 04:12:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1342496 - in /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common: ./ src/main/java/org/apache/hadoop/fs/ src/test/java/org/apache/hadoop/fs/ src/test/java/org/apache/hadoop/fs/s3/ src/test/java/org/apache/hadoop/fs/s3native/ Date: Fri, 25 May 2012 04:12:14 -0000 To: common-commits@hadoop.apache.org From: eli@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120525041215.30FE02388865@eris.apache.org> Author: eli Date: Fri May 25 04:12:14 2012 New Revision: 1342496 URL: http://svn.apache.org/viewvc?rev=1342496&view=rev Log: HADOOP-8422. Deprecate FileSystem#getDefault* and getServerDefault methods that don't take a Path argument. Contributed by Eli Collins Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemTestHelper.java hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/s3/S3FileSystemContractBaseTest.java hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1342496&r1=1342495&r2=1342496&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt Fri May 25 04:12:14 2012 @@ -221,6 +221,9 @@ Release 2.0.0-alpha - UNRELEASED OPTIMIZATIONS + HADOOP-8422. Deprecate FileSystem#getDefault* and getServerDefault + methods that don't take a Path argument. (eli) + BUG FIXES HADOOP-8199. Fix issues in start-all.sh and stop-all.sh (Devaraj K via umamahesh) Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java?rev=1342496&r1=1342495&r2=1342496&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java Fri May 25 04:12:14 2012 @@ -615,7 +615,9 @@ public abstract class FileSystem extends * Return a set of server default configuration values * @return server default configuration values * @throws IOException + * @deprecated use {@link #getServerDefaults(Path)} instead */ + @Deprecated public FsServerDefaults getServerDefaults() throws IOException { Configuration conf = getConf(); return new FsServerDefaults(getDefaultBlockSize(), @@ -1939,8 +1941,12 @@ public abstract class FileSystem extends return getFileStatus(f).getBlockSize(); } - /** Return the number of bytes that large input files should be optimally - * be split into to minimize i/o time. */ + /** + * Return the number of bytes that large input files should be optimally + * be split into to minimize i/o time. + * @deprecated use {@link #getDefaultBlockSize(Path)} instead + */ + @Deprecated public long getDefaultBlockSize() { // default to 32MB: large enough to minimize the impact of seeks return getConf().getLong("fs.local.block.size", 32 * 1024 * 1024); @@ -1958,7 +1964,9 @@ public abstract class FileSystem extends /** * Get the default replication. + * @deprecated use {@link #getDefaultReplication(Path)} instead */ + @Deprecated public short getDefaultReplication() { return 1; } /** Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java?rev=1342496&r1=1342495&r2=1342496&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java Fri May 25 04:12:14 2012 @@ -316,7 +316,7 @@ public class RawLocalFileSystem extends } if (localf.isFile()) { return new FileStatus[] { - new RawLocalFileStatus(localf, getDefaultBlockSize(), this) }; + new RawLocalFileStatus(localf, getDefaultBlockSize(f), this) }; } String[] names = localf.list(); @@ -444,7 +444,7 @@ public class RawLocalFileSystem extends public FileStatus getFileStatus(Path f) throws IOException { File path = pathToFile(f); if (path.exists()) { - return new RawLocalFileStatus(pathToFile(f), getDefaultBlockSize(), this); + return new RawLocalFileStatus(pathToFile(f), getDefaultBlockSize(f), this); } else { throw new FileNotFoundException("File " + f + " does not exist"); } Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemTestHelper.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemTestHelper.java?rev=1342496&r1=1342495&r2=1342496&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemTestHelper.java (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemTestHelper.java Fri May 25 04:12:14 2012 @@ -113,7 +113,7 @@ public final class FileSystemTestHelper public static long createFile(FileSystem fSys, Path path, int numBlocks, int blockSize, boolean createParent) throws IOException { - return createFile(fSys, path, numBlocks, blockSize, fSys.getDefaultReplication(), true); + return createFile(fSys, path, numBlocks, blockSize, fSys.getDefaultReplication(path), true); } public static long createFile(FileSystem fSys, Path path, int numBlocks, Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/s3/S3FileSystemContractBaseTest.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/s3/S3FileSystemContractBaseTest.java?rev=1342496&r1=1342495&r2=1342496&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/s3/S3FileSystemContractBaseTest.java (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/s3/S3FileSystemContractBaseTest.java Fri May 25 04:12:14 2012 @@ -47,11 +47,9 @@ public abstract class S3FileSystemContra } public void testBlockSize() throws Exception { - - long newBlockSize = fs.getDefaultBlockSize() * 2; - fs.getConf().setLong("fs.s3.block.size", newBlockSize); - Path file = path("/test/hadoop/file"); + long newBlockSize = fs.getDefaultBlockSize(file) * 2; + fs.getConf().setLong("fs.s3.block.size", newBlockSize); createFile(file); assertEquals("Double default block size", newBlockSize, fs.getFileStatus(file).getBlockSize()); Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java?rev=1342496&r1=1342495&r2=1342496&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/s3native/NativeS3FileSystemContractBaseTest.java Fri May 25 04:12:14 2012 @@ -141,11 +141,11 @@ public abstract class NativeS3FileSystem public void testBlockSize() throws Exception { Path file = path("/test/hadoop/file"); createFile(file); - assertEquals("Default block size", fs.getDefaultBlockSize(), + assertEquals("Default block size", fs.getDefaultBlockSize(file), fs.getFileStatus(file).getBlockSize()); // Block size is determined at read time - long newBlockSize = fs.getDefaultBlockSize() * 2; + long newBlockSize = fs.getDefaultBlockSize(file) * 2; fs.getConf().setLong("fs.s3n.block.size", newBlockSize); assertEquals("Double default block size", newBlockSize, fs.getFileStatus(file).getBlockSize());