hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject hadoop git commit: HDFS-11287. Storage class member storageDirs should be private to avoid unprotected access by derived classes. (Manoj Govindassamy via lei)
Date Thu, 19 Jan 2017 07:42:52 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 724bb8635 -> 63320d1da


HDFS-11287. Storage class member storageDirs should be private to avoid unprotected access
by derived classes. (Manoj Govindassamy via lei)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/63320d1d
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/63320d1d
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/63320d1d

Branch: refs/heads/trunk
Commit: 63320d1daab7ce846bb180623378efe431ad8c52
Parents: 724bb86
Author: Lei Xu <lei@apache.org>
Authored: Thu Jan 19 15:36:54 2017 +0800
Committer: Lei Xu <lei@apache.org>
Committed: Thu Jan 19 15:38:20 2017 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hdfs/server/common/Storage.java  | 4 ++--
 .../hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java       | 2 +-
 .../java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/63320d1d/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
index f23a48a..519c28f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
@@ -124,9 +124,9 @@ public abstract class Storage extends StorageInfo {
     public boolean isOfType(StorageDirType type);
   }
 
-  protected List<StorageDirectory> storageDirs =
+  private final List<StorageDirectory> storageDirs =
       new CopyOnWriteArrayList<>();
-  
+
   private class DirIterator implements Iterator<StorageDirectory> {
     final StorageDirType dirType;
     final boolean includeShared;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/63320d1d/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
index 3203de2..bc41715 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
@@ -299,7 +299,7 @@ public class BlockPoolSliceStorage extends Storage {
          it.hasNext(); ) {
       StorageDirectory sd = it.next();
       if (sd.getRoot().getAbsoluteFile().equals(absPathToRemove)) {
-        this.storageDirs.remove(sd);
+        getStorageDirs().remove(sd);
         break;
       }
     }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/63320d1d/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
index f410a85..a5324be 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
@@ -508,7 +508,7 @@ public class DataStorage extends Storage {
           bpsStorage.remove(bpRoot.getAbsoluteFile());
         }
 
-        this.storageDirs.remove(sd);
+        getStorageDirs().remove(sd);
         try {
           sd.unlock();
         } catch (IOException e) {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message