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:33 UTC
[26/50] [abbrv] hadoop git commit: HDDS-51. Fix
TestDeletedBlockLog#testDeletedBlockTransactions. Contributed by Mukul Kumar
Singh.
HDDS-51. Fix TestDeletedBlockLog#testDeletedBlockTransactions.
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/32cbd0cf
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/32cbd0cf
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/32cbd0cf
Branch: refs/heads/HDDS-4
Commit: 32cbd0cfd696a8293ac1c726081da9191cacecee
Parents: 53c8ebc
Author: Anu Engineer <ae...@apache.org>
Authored: Sat May 12 13:37:34 2018 -0700
Committer: Anu Engineer <ae...@apache.org>
Committed: Sat May 12 13:37:34 2018 -0700
----------------------------------------------------------------------
.../apache/hadoop/hdds/scm/block/TestDeletedBlockLog.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/32cbd0cf/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestDeletedBlockLog.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestDeletedBlockLog.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestDeletedBlockLog.java
index f872e23..8c12806 100644
--- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestDeletedBlockLog.java
+++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestDeletedBlockLog.java
@@ -18,6 +18,7 @@
package org.apache.hadoop.hdds.scm.block;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.RandomUtils;
import org.apache.hadoop.hdds.scm.container.ContainerMapping;
import org.apache.hadoop.hdds.scm.container.Mapping;
import org.apache.hadoop.hdds.scm.container.common.helpers.ContainerInfo;
@@ -88,12 +89,10 @@ public class TestDeletedBlockLog {
int continerIDBase = random.nextInt(100);
int localIDBase = random.nextInt(1000);
for (int i = 0; i < dataSize; i++) {
- //String containerName = "container-" + UUID.randomUUID().toString();
long containerID = continerIDBase + i;
List<Long> blocks = new ArrayList<>();
int blockSize = random.nextInt(30) + 1;
for (int j = 0; j < blockSize; j++) {
- //blocks.add("block-" + UUID.randomUUID().toString());
long localID = localIDBase + j;
blocks.add(localID);
}
@@ -266,7 +265,7 @@ public class TestDeletedBlockLog {
int count = 0;
long containerID = 0L;
- DatanodeDetails dnDd1 = DatanodeDetails.newBuilder()
+ DatanodeDetails dnId1 = DatanodeDetails.newBuilder()
.setUuid(UUID.randomUUID().toString())
.setIpAddress("127.0.0.1")
.setHostName("localhost")
@@ -293,7 +292,7 @@ public class TestDeletedBlockLog {
// make TX[1-6] for datanode1; TX[7-10] for datanode2
if (count <= (maximumAllowedTXNum + 1)) {
- mockContainerInfo(mappingService, containerID, dnDd1);
+ mockContainerInfo(mappingService, containerID, dnId1);
} else {
mockContainerInfo(mappingService, containerID, dnId2);
}
@@ -323,7 +322,7 @@ public class TestDeletedBlockLog {
Assert.assertFalse(transactions.isFull());
// The number of TX in dnID1 won't more than maximum value.
Assert.assertEquals(maximumAllowedTXNum,
- transactions.getDatanodeTransactions(dnDd1.getUuid()).size());
+ transactions.getDatanodeTransactions(dnId1.getUuid()).size());
int size = transactions.getDatanodeTransactions(dnId2.getUuid()).size();
// add duplicated container in dnID2, this should be failed.
@@ -339,6 +338,7 @@ public class TestDeletedBlockLog {
transactions.getDatanodeTransactions(dnId2.getUuid()).size());
// Add new TX in dnID2, then dnID2 will reach maximum value.
+ containerID = RandomUtils.nextLong();
builder = DeletedBlocksTransaction.newBuilder();
builder.setTxID(12);
builder.setContainerID(containerID);
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org