You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by xy...@apache.org on 2018/05/15 23:58:32 UTC

[25/50] [abbrv] hadoop git commit: HDDS-32. Fix TestContainerDeletionChoosingPolicy#testTopNOrderedChoosingPolicy. Contributed by Mukul Kumar Singh.

HDDS-32. Fix TestContainerDeletionChoosingPolicy#testTopNOrderedChoosingPolicy.
Contributed by Mukul Kumar Singh.


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

Branch: refs/heads/HDDS-4
Commit: 53c8ebcd0285ca91f7d758084cd91df93af0ffb3
Parents: cd8b9e9
Author: Anu Engineer <ae...@apache.org>
Authored: Sat May 12 10:18:53 2018 -0700
Committer: Anu Engineer <ae...@apache.org>
Committed: Sat May 12 10:24:06 2018 -0700

----------------------------------------------------------------------
 .../common/impl/TestContainerDeletionChoosingPolicy.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/53c8ebcd/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerDeletionChoosingPolicy.java
----------------------------------------------------------------------
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerDeletionChoosingPolicy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerDeletionChoosingPolicy.java
index 331db40..4344419 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerDeletionChoosingPolicy.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerDeletionChoosingPolicy.java
@@ -28,6 +28,7 @@ import java.util.Map;
 import java.util.Random;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.RandomUtils;
 import org.apache.hadoop.hdds.scm.TestUtils;
 import org.apache.hadoop.hdfs.DFSUtil;
 import org.apache.hadoop.hdfs.server.datanode.StorageLocation;
@@ -138,14 +139,14 @@ public class TestContainerDeletionChoosingPolicy {
 
     int numContainers = 10;
     Random random = new Random();
-    Map<String, Integer> name2Count = new HashMap<>();
+    Map<Long, Integer> name2Count = new HashMap<>();
     // create [numContainers + 1] containers
     for (int i = 0; i <= numContainers; i++) {
-      String containerName = OzoneUtils.getRequestID();
-      ContainerData data = new ContainerData(new Long(i), conf);
+      long containerId = RandomUtils.nextLong();
+      ContainerData data = new ContainerData(containerId, conf);
       containerManager.createContainer(data);
       Assert.assertTrue(
-          containerManager.getContainerMap().containsKey(containerName));
+          containerManager.getContainerMap().containsKey(containerId));
 
       // don't create deletion blocks in the last container.
       if (i == numContainers) {
@@ -155,7 +156,7 @@ public class TestContainerDeletionChoosingPolicy {
       // create random number of deletion blocks and write to container db
       int deletionBlocks = random.nextInt(numContainers) + 1;
       // record <ContainerName, DeletionCount> value
-      name2Count.put(containerName, deletionBlocks);
+      name2Count.put(containerId, deletionBlocks);
       for (int j = 0; j <= deletionBlocks; j++) {
         MetadataStore metadata = KeyUtils.getDB(data, conf);
         String blk = "blk" + i + "-" + j;


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