hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From inigo...@apache.org
Subject [08/48] hadoop git commit: HDFS-11964. Decoding inputs should be correctly prepared in pread. Contributed by Takanobu Asanuma
Date Sat, 02 Sep 2017 21:20:52 GMT
HDFS-11964. Decoding inputs should be correctly prepared in pread. Contributed by Takanobu
Asanuma


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7a96033b
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7a96033b
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7a96033b

Branch: refs/heads/HDFS-10467
Commit: 7a96033b15580a01a2867fa3cab9c1e409dbaafd
Parents: 1b3b993
Author: Kai Zheng <kai.zheng@intel.com>
Authored: Fri Sep 1 17:48:26 2017 +0800
Committer: Kai Zheng <kai.zheng@intel.com>
Committed: Fri Sep 1 17:48:26 2017 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hdfs/PositionStripeReader.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/7a96033b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PositionStripeReader.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PositionStripeReader.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PositionStripeReader.java
index 1e9d638..b01b74c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PositionStripeReader.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PositionStripeReader.java
@@ -57,6 +57,10 @@ class PositionStripeReader extends StripeReader {
     Preconditions.checkState(index >= dataBlkNum &&
         alignedStripe.chunks[index] == null);
 
+    int bufLen = (int) alignedStripe.getSpanInBlock();
+    decodeInputs[index] = new ECChunk(codingBuffer.duplicate(), index * bufLen,
+        bufLen);
+
     alignedStripe.chunks[index] =
         new StripingChunk(decodeInputs[index].getBuffer());
 
@@ -75,7 +79,7 @@ class PositionStripeReader extends StripeReader {
     codingBuffer = dfsStripedInputStream.getBufferPool().
         getBuffer(useDirectBuffer(), bufLen * bufCount);
     ByteBuffer buffer;
-    for (int i = 0; i < decodeInputs.length; i++) {
+    for (int i = 0; i < dataBlkNum; i++) {
       buffer = codingBuffer.duplicate();
       decodeInputs[i] = new ECChunk(buffer, i * bufLen, bufLen);
     }


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