hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject hadoop git commit: HDFS-12958. Ozone: remove setAllocatedBytes method in ContainerInfo. Contributed by Chen Liang.
Date Sun, 24 Dec 2017 13:24:43 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7240 c0ce0a580 -> c5dcf3a6e


HDFS-12958. Ozone: remove setAllocatedBytes method in ContainerInfo. Contributed by Chen Liang.


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

Branch: refs/heads/HDFS-7240
Commit: c5dcf3a6ecf80f66d09185e2bfbc8990f1680bcf
Parents: c0ce0a5
Author: Nanda kumar <nanda@apache.org>
Authored: Sun Dec 24 18:54:11 2017 +0530
Committer: Nanda kumar <nanda@apache.org>
Committed: Sun Dec 24 18:54:11 2017 +0530

----------------------------------------------------------------------
 .../scm/container/common/helpers/ContainerInfo.java     |  4 ----
 .../hadoop/ozone/scm/container/ContainerMapping.java    | 12 ++++++++++--
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c5dcf3a6/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/container/common/helpers/ContainerInfo.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/container/common/helpers/ContainerInfo.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/container/common/helpers/ContainerInfo.java
index 1c3442a..ff8bcdb 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/container/common/helpers/ContainerInfo.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/container/common/helpers/ContainerInfo.java
@@ -100,10 +100,6 @@ public class ContainerInfo
     return allocatedBytes;
   }
 
-  public void setAllocatedBytes(long allocatedBytes) {
-    this.allocatedBytes = allocatedBytes;
-  }
-
   public long getUsedBytes() {
     return usedBytes;
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c5dcf3a6/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
index 2c1d3c4..47b84f9 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
@@ -480,8 +480,16 @@ public class ContainerMapping implements Mapping {
           OzoneProtos.SCMContainerInfo oldInfoProto =
               OzoneProtos.SCMContainerInfo.PARSER.parseFrom(containerBytes);
           ContainerInfo oldInfo = ContainerInfo.fromProtobuf(oldInfoProto);
-          oldInfo.setAllocatedBytes(info.getAllocatedBytes());
-          containerStore.put(dbKey, oldInfo.getProtobuf().toByteArray());
+          ContainerInfo newInfo = new ContainerInfo.Builder()
+              .setAllocatedBytes(info.getAllocatedBytes())
+              .setContainerName(oldInfo.getContainerName())
+              .setNumberOfKeys(oldInfo.getNumberOfKeys())
+              .setOwner(oldInfo.getOwner())
+              .setPipeline(oldInfo.getPipeline())
+              .setState(oldInfo.getState())
+              .setUsedBytes(oldInfo.getUsedBytes())
+              .build();
+          containerStore.put(dbKey, newInfo.getProtobuf().toByteArray());
         } else {
           LOG.debug("Container state manager has container {} but not found " +
               "in container store, a deleted container?",


---------------------------------------------------------------------
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