From 24ddec9b2c2c76ba3b384f8e048d29313617a322 Mon Sep 17 00:00:00 2001 From: litao Date: Fri, 26 Jul 2024 10:10:47 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"HDFS-16776=20Erasure=20Coding:=20The?= =?UTF-8?q?=20length=20of=20targets=20should=20be=20checked=20wh=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9a29075f915173e24c77cf8aea2908da0aa328e3. --- .../server/datanode/erasurecode/StripedReconstructor.java | 4 ---- .../hdfs/server/datanode/erasurecode/StripedWriter.java | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedReconstructor.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedReconstructor.java index 7acb679200118..466c7c4254c8b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedReconstructor.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedReconstructor.java @@ -288,10 +288,6 @@ RawErasureDecoder getDecoder() { return decoder; } - int getNumLiveBlocks(){ - return liveBitSet.cardinality(); - } - void cleanup() { if (decoder != null) { decoder.release(); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedWriter.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedWriter.java index 00be1279c8179..ca06dfc120531 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedWriter.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedWriter.java @@ -82,10 +82,8 @@ class StripedWriter { assert targetStorageIds != null; writers = new StripedBlockWriter[targets.length]; + targetIndices = new short[targets.length]; - Preconditions.checkArgument( - targetIndices.length <= dataBlkNum + parityBlkNum - reconstructor.getNumLiveBlocks(), - "Reconstruction work gets too much targets."); Preconditions.checkArgument(targetIndices.length <= parityBlkNum, "Too much missed striped blocks."); initTargetIndices();