You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by so...@apache.org on 2021/11/30 20:58:37 UTC
[ozone] branch HDDS-3816-ec updated: HDDS-6009. EC: Optimize ECBlockReconstructedStripeInputStream where there are no missing data indexes (#2872)
This is an automated email from the ASF dual-hosted git repository.
sodonnell pushed a commit to branch HDDS-3816-ec
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/HDDS-3816-ec by this push:
new 6e7d0dc HDDS-6009. EC: Optimize ECBlockReconstructedStripeInputStream where there are no missing data indexes (#2872)
6e7d0dc is described below
commit 6e7d0dc2063006de0663416198767f214af19e56
Author: Stephen O'Donnell <st...@gmail.com>
AuthorDate: Tue Nov 30 20:58:20 2021 +0000
HDDS-6009. EC: Optimize ECBlockReconstructedStripeInputStream where there are no missing data indexes (#2872)
---
.../io/ECBlockReconstructedStripeInputStream.java | 19 +++++++++++++------
.../TestECBlockReconstructedStripeInputStream.java | 6 ++++++
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java
index 1fdb7a2..b6478c5 100644
--- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java
+++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java
@@ -246,12 +246,19 @@ public class ECBlockReconstructedStripeInputStream extends ECBlockInputStream {
}
}
}
- padBuffers(toRead);
- flipInputs();
- decodeStripe();
- // Reset the buffer positions after padding to the read limits so the client
- // reads the correct amount of data.
- setBufferReadLimits(bufs, toRead);
+ if (missingIndexes.length > 0) {
+ padBuffers(toRead);
+ flipInputs();
+ decodeStripe();
+ // Reset the buffer positions and limits to remove any padding added
+ // before EC Decode.
+ setBufferReadLimits(bufs, toRead);
+ } else {
+ // If we have no missing indexes, then the buffers will be at their
+ // limits after reading so we need to flip them to ensure they are ready
+ // to read by the caller.
+ flipInputs();
+ }
setPos(getPos() + toRead);
return toRead;
}
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedStripeInputStream.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedStripeInputStream.java
index 8b1d460..875d2a7 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedStripeInputStream.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedStripeInputStream.java
@@ -126,6 +126,8 @@ public class TestECBlockReconstructedStripeInputStream {
locations.add(ECStreamTestUtil.createIndexMap(2, 4, 5));
// One data and one parity missing
locations.add(ECStreamTestUtil.createIndexMap(2, 3, 4));
+ // No missing indexes
+ locations.add(ECStreamTestUtil.createIndexMap(1, 2, 3, 4, 5));
for (Map<DatanodeDetails, Integer> dnMap : locations) {
streamFactory = new TestBlockInputStreamFactory();
@@ -280,6 +282,8 @@ public class TestECBlockReconstructedStripeInputStream {
locations.add(ECStreamTestUtil.createIndexMap(2, 3, 4));
// One data and one parity missing
locations.add(ECStreamTestUtil.createIndexMap(1, 2, 4));
+ // No indexes missing
+ locations.add(ECStreamTestUtil.createIndexMap(1, 2, 3, 4, 5));
for (Map<DatanodeDetails, Integer> dnMap : locations) {
streamFactory = new TestBlockInputStreamFactory();
@@ -366,6 +370,8 @@ public class TestECBlockReconstructedStripeInputStream {
locations.add(ECStreamTestUtil.createIndexMap(2, 4, 5));
// One data and one parity missing
locations.add(ECStreamTestUtil.createIndexMap(2, 3, 4));
+ // No locations missing
+ locations.add(ECStreamTestUtil.createIndexMap(1, 2, 3, 4, 5));
for (Map<DatanodeDetails, Integer> dnMap : locations) {
streamFactory = new TestBlockInputStreamFactory();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org