hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hadoop] goiri commented on a change in pull request #1573: HDFS-14889. Ability to check if a block has a replica on provided storage.
Date Thu, 03 Oct 2019 18:16:57 GMT
goiri commented on a change in pull request #1573: HDFS-14889. Ability to check if a block
has a replica on provided storage.
URL: https://github.com/apache/hadoop/pull/1573#discussion_r331182441
 
 

 ##########
 File path: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockInfo.java
 ##########
 @@ -64,6 +67,28 @@ public void testAddStorage() throws Exception {
     Assert.assertEquals(storage, blockInfo.getStorageInfo(0));
   }
 
+  @Test
+  public void testAddProvidedStorage() throws Exception {
+    BlockInfo blockInfo = new BlockInfoContiguous((short) 3);
+
+    DatanodeStorageInfo storage = mock(DatanodeStorageInfo.class);
+    when(storage.getStorageType()).thenReturn(StorageType.PROVIDED);
+    boolean added = blockInfo.addStorage(storage, blockInfo);
+
+    Assert.assertTrue(added);
+    Assert.assertEquals(storage, blockInfo.getStorageInfo(0));
+    Assert.assertTrue(blockInfo.isProvided());
+
 
 Review comment:
   I'm more concerned about readability. Renaming the second one is fine with me.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


Mime
View raw message