Author: suresh Date: Thu Mar 27 04:27:50 2014 New Revision: 1582182 URL: http://svn.apache.org/r1582182 Log: HDFS-6162. Merge r1582181 from trunk.
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/LsrPBImage.java Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1582182&r1=1582181&r2=1582182&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Thu Mar 27 04:27:50 2014 @@ -33,6 +33,9 @@ Release 2.5.0 - UNRELEASED HDFS-3087. Decomissioning on NN restart can complete without blocks being replicated. (Rushabh S Shah via kihwal) + HDFS-6162. Format strings should use platform independent line separator. + (suresh) + Release 2.4.0 - UNRELEASED INCOMPATIBLE CHANGES Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java?rev=1582182&r1=1582181&r2=1582182&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java Thu Mar 27 04:27:50 2014 @@ -801,7 +801,7 @@ implements ByteBufferReadable, CanSetDro // got a EOS from reader though we expect more data on it. throw new IOException("Unexpected EOS from the reader"); } - if (dfsClient.stats != null && result != -1) { + if (dfsClient.stats != null) { dfsClient.stats.incrementBytesRead(result); } return result; Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=1582182&r1=1582181&r2=1582182&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java Thu Mar 27 04:27:50 2014 @@ -4985,7 +4985,7 @@ public class FSNamesystem implements Nam if (blockSafe < blockThreshold) { msg += String.format( "The reported blocks %d needs additional %d" - + " blocks to reach the threshold %.4f of total blocks %d.\n", + + " blocks to reach the threshold %.4f of total blocks %d.%n", blockSafe, (blockThreshold - blockSafe) + 1, threshold, blockTotal); thresholdsMet = false; } else { @@ -4995,7 +4995,7 @@ public class FSNamesystem implements Nam if (numLive < datanodeThreshold) { msg += String.format( "The number of live datanodes %d needs an additional %d live " - + "datanodes to reach the minimum number %d.\n", + + "datanodes to reach the minimum number %d.%n", numLive, (datanodeThreshold - numLive), datanodeThreshold); thresholdsMet = false; } else { Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java?rev=1582182&r1=1582181&r2=1582182&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java Thu Mar 27 04:27:50 2014 @@ -583,7 +583,7 @@ public class CacheAdmin extends Configur tableListing.addRow(row.toArray(new String[0])); numEntries++; } - System.out.print(String.format("Found %d entr%s\n", + System.out.print(String.format("Found %d entr%s%n", numEntries, numEntries == 1 ? "y" : "ies")); if (numEntries > 0) { System.out.print(tableListing); @@ -968,7 +968,7 @@ public class CacheAdmin extends Configur System.err.println(prettifyException(e)); return 2; } - System.out.print(String.format("Found %d result%s.\n", numResults, + System.out.print(String.format("Found %d result%s.%n", numResults, (numResults == 1 ? "" : "s"))); if (numResults > 0) { System.out.print(listing); Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/LsrPBImage.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/LsrPBImage.java?rev=1582182&r1=1582181&r2=1582182&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/LsrPBImage.java (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/LsrPBImage.java Thu Mar 27 04:27:50 2014 @@ -159,7 +159,7 @@ final class LsrPBImage { INodeFile f = inode.getFile(); PermissionStatus p = FSImageFormatPBINode.Loader.loadPermission( f.getPermission(), stringTable); - out.print(String.format("-%s %2s %8s %10s %10s %10d %s%s\n", p + out.print(String.format("-%s %2s %8s %10s %10s %10d %s%s%n", p .getPermission().toString(), f.getReplication(), p.getUserName(), p .getGroupName(), f.getModificationTime(), getFileSize(f), parent, inode.getName().toStringUtf8())); @@ -169,7 +169,7 @@ final class LsrPBImage { INodeDirectory d = inode.getDirectory(); PermissionStatus p = FSImageFormatPBINode.Loader.loadPermission( d.getPermission(), stringTable); - out.print(String.format("d%s - %8s %10s %10s %10d %s%s\n", p + out.print(String.format("d%s - %8s %10s %10s %10d %s%s%n", p .getPermission().toString(), p.getUserName(), p.getGroupName(), d .getModificationTime(), 0, parent, inode.getName().toStringUtf8())); } @@ -178,7 +178,7 @@ final class LsrPBImage { INodeSymlink d = inode.getSymlink(); PermissionStatus p = FSImageFormatPBINode.Loader.loadPermission( d.getPermission(), stringTable); - out.print(String.format("-%s - %8s %10s %10s %10d %s%s -> %s\n", p + out.print(String.format("-%s - %8s %10s %10s %10d %s%s -> %s%n", p .getPermission().toString(), p.getUserName(), p.getGroupName(), d .getModificationTime(), 0, parent, inode.getName().toStringUtf8(), d.getTarget().toStringUtf8()));