hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ayushsax...@apache.org
Subject [hadoop] branch trunk updated: HDFS-15143. LocatedStripedBlock returns wrong block type. Contributed by Ayush Saxena.
Date Tue, 28 Jan 2020 14:12:51 GMT
This is an automated email from the ASF dual-hosted git repository.

ayushsaxena pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f876dc2  HDFS-15143. LocatedStripedBlock returns wrong block type. Contributed by
Ayush Saxena.
f876dc2 is described below

commit f876dc228b263d823baf6ab198d211e57e100985
Author: Ayush Saxena <ayushsaxena@apache.org>
AuthorDate: Tue Jan 28 19:34:21 2020 +0530

    HDFS-15143. LocatedStripedBlock returns wrong block type. Contributed by Ayush Saxena.
---
 .../java/org/apache/hadoop/hdfs/protocol/LocatedStripedBlock.java | 5 +++++
 .../java/org/apache/hadoop/hdfs/util/TestStripedBlockUtil.java    | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedStripedBlock.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedStripedBlock.java
index 7a66072..ad67e64 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedStripedBlock.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedStripedBlock.java
@@ -77,6 +77,11 @@ public class LocatedStripedBlock extends LocatedBlock {
     return true;
   }
 
+  @Override
+  public BlockType getBlockType() {
+    return BlockType.STRIPED;
+  }
+
   public Token<BlockTokenIdentifier>[] getBlockTokens() {
     return blockTokens;
   }
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/util/TestStripedBlockUtil.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/util/TestStripedBlockUtil.java
index fe6bb09..df38e82 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/util/TestStripedBlockUtil.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/util/TestStripedBlockUtil.java
@@ -22,6 +22,7 @@ import com.google.common.base.Preconditions;
 import org.apache.hadoop.fs.StorageType;
 import org.apache.hadoop.hdfs.DFSTestUtil;
 import org.apache.hadoop.hdfs.StripedFileTestUtil;
+import org.apache.hadoop.hdfs.protocol.BlockType;
 import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
 import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
 import org.apache.hadoop.hdfs.protocol.LocatedBlock;
@@ -174,6 +175,13 @@ public class TestStripedBlockUtil {
   }
 
   @Test
+  public void testLocatedStripedBlockType() {
+    LocatedStripedBlock lsb =
+        new LocatedStripedBlock(null, null, null, null, null, 0, false, null);
+    assertEquals(BlockType.STRIPED, lsb.getBlockType());
+  }
+
+  @Test
   public void testParseDummyStripedBlock() {
     LocatedStripedBlock lsb = createDummyLocatedBlock(
         stripeSize * stripesPerBlock);


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