浏览代码

HADOOP-5127. Merge -r 743044:743045 from trunk to branch 0.20.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20@743054 13f79535-47bb-0310-9956-ffa450edef68
Konstantin Shvachko 16 年之前
父节点
当前提交
601610c78d
共有 2 个文件被更改,包括 12 次插入10 次删除
  1. 2 0
      CHANGES.txt
  2. 10 10
      src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java

+ 2 - 0
CHANGES.txt

@@ -609,6 +609,8 @@ Release 0.19.1 - Unreleased
 
 
     HADOOP-5126. Remove empty file BlocksWithLocations.java (shv)
     HADOOP-5126. Remove empty file BlocksWithLocations.java (shv)
 
 
+    HADOOP-5127. Remove public methods in FSDirectory. (Jakob Homan via shv)
+
   BUG FIXES
   BUG FIXES
 
 
     HADOOP-4697. Fix getBlockLocations in KosmosFileSystem to handle multiple
     HADOOP-4697. Fix getBlockLocations in KosmosFileSystem to handle multiple

+ 10 - 10
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java

@@ -48,18 +48,18 @@ class FSDirectory implements FSConstants, Closeable {
   final FSNamesystem namesystem;
   final FSNamesystem namesystem;
   final INodeDirectoryWithQuota rootDir;
   final INodeDirectoryWithQuota rootDir;
   FSImage fsImage;  
   FSImage fsImage;  
-  boolean ready = false;
+  private boolean ready = false;
   // Metrics record
   // Metrics record
   private MetricsRecord directoryMetrics = null;
   private MetricsRecord directoryMetrics = null;
 
 
   /** Access an existing dfs name directory. */
   /** Access an existing dfs name directory. */
-  public FSDirectory(FSNamesystem ns, Configuration conf) throws IOException {
+  FSDirectory(FSNamesystem ns, Configuration conf) {
     this(new FSImage(), ns, conf);
     this(new FSImage(), ns, conf);
     fsImage.setCheckpointDirectories(FSImage.getCheckpointDirs(conf, null),
     fsImage.setCheckpointDirectories(FSImage.getCheckpointDirs(conf, null),
                                 FSImage.getCheckpointEditsDirs(conf, null));
                                 FSImage.getCheckpointEditsDirs(conf, null));
   }
   }
 
 
-  public FSDirectory(FSImage fsImage, FSNamesystem ns, Configuration conf) throws IOException {
+  FSDirectory(FSImage fsImage, FSNamesystem ns, Configuration conf) {
     rootDir = new INodeDirectoryWithQuota(INodeDirectory.ROOT_NAME,
     rootDir = new INodeDirectoryWithQuota(INodeDirectory.ROOT_NAME,
         ns.createFsOwnerPermissions(new FsPermission((short)0755)),
         ns.createFsOwnerPermissions(new FsPermission((short)0755)),
         Integer.MAX_VALUE, -1);
         Integer.MAX_VALUE, -1);
@@ -497,7 +497,7 @@ class FSDirectory implements FSConstants, Closeable {
    * @return the number of bytes 
    * @return the number of bytes 
    * @throws IOException if it is a directory or does not exist.
    * @throws IOException if it is a directory or does not exist.
    */
    */
-  public long getPreferredBlockSize(String filename) throws IOException {
+  long getPreferredBlockSize(String filename) throws IOException {
     synchronized (rootDir) {
     synchronized (rootDir) {
       INode fileNode = rootDir.getNode(filename);
       INode fileNode = rootDir.getNode(filename);
       if (fileNode == null) {
       if (fileNode == null) {
@@ -560,7 +560,7 @@ class FSDirectory implements FSConstants, Closeable {
   /**
   /**
    * Remove the file from management, return blocks
    * Remove the file from management, return blocks
    */
    */
-  public INode delete(String src) {
+  INode delete(String src) {
     if (NameNode.stateChangeLog.isDebugEnabled()) {
     if (NameNode.stateChangeLog.isDebugEnabled()) {
       NameNode.stateChangeLog.debug("DIR* FSDirectory.delete: "+src);
       NameNode.stateChangeLog.debug("DIR* FSDirectory.delete: "+src);
     }
     }
@@ -574,8 +574,8 @@ class FSDirectory implements FSConstants, Closeable {
   }
   }
   
   
   /** Return if a directory is empty or not **/
   /** Return if a directory is empty or not **/
-  public boolean isDirEmpty(String src) {
-	boolean dirNotEmpty = true;
+  boolean isDirEmpty(String src) {
+	   boolean dirNotEmpty = true;
     if (!isDir(src)) {
     if (!isDir(src)) {
       return true;
       return true;
     }
     }
@@ -697,7 +697,7 @@ class FSDirectory implements FSConstants, Closeable {
    * This function is admittedly very inefficient right now.  We'll
    * This function is admittedly very inefficient right now.  We'll
    * make it better later.
    * make it better later.
    */
    */
-  public FileStatus[] getListing(String src) {
+  FileStatus[] getListing(String src) {
     String srcs = normalizePath(src);
     String srcs = normalizePath(src);
 
 
     synchronized (rootDir) {
     synchronized (rootDir) {
@@ -786,7 +786,7 @@ class FSDirectory implements FSConstants, Closeable {
   /** 
   /** 
    * Check whether the filepath could be created
    * Check whether the filepath could be created
    */
    */
-  public boolean isValidToCreate(String src) {
+  boolean isValidToCreate(String src) {
     String srcs = normalizePath(src);
     String srcs = normalizePath(src);
     synchronized (rootDir) {
     synchronized (rootDir) {
       if (srcs.startsWith("/") && 
       if (srcs.startsWith("/") && 
@@ -802,7 +802,7 @@ class FSDirectory implements FSConstants, Closeable {
   /**
   /**
    * Check whether the path specifies a directory
    * Check whether the path specifies a directory
    */
    */
-  public boolean isDir(String src) {
+  boolean isDir(String src) {
     synchronized (rootDir) {
     synchronized (rootDir) {
       INode node = rootDir.getNode(normalizePath(src));
       INode node = rootDir.getNode(normalizePath(src));
       return node != null && node.isDirectory();
       return node != null && node.isDirectory();