HDFS-11964. Decoding inputs should be correctly prepared in pread. Contributed by Takanobu Asanuma
This commit is contained in:
parent
1b3b9938cf
commit
7a96033b15
|
@ -57,6 +57,10 @@ class PositionStripeReader extends StripeReader {
|
||||||
Preconditions.checkState(index >= dataBlkNum &&
|
Preconditions.checkState(index >= dataBlkNum &&
|
||||||
alignedStripe.chunks[index] == null);
|
alignedStripe.chunks[index] == null);
|
||||||
|
|
||||||
|
int bufLen = (int) alignedStripe.getSpanInBlock();
|
||||||
|
decodeInputs[index] = new ECChunk(codingBuffer.duplicate(), index * bufLen,
|
||||||
|
bufLen);
|
||||||
|
|
||||||
alignedStripe.chunks[index] =
|
alignedStripe.chunks[index] =
|
||||||
new StripingChunk(decodeInputs[index].getBuffer());
|
new StripingChunk(decodeInputs[index].getBuffer());
|
||||||
|
|
||||||
|
@ -75,7 +79,7 @@ class PositionStripeReader extends StripeReader {
|
||||||
codingBuffer = dfsStripedInputStream.getBufferPool().
|
codingBuffer = dfsStripedInputStream.getBufferPool().
|
||||||
getBuffer(useDirectBuffer(), bufLen * bufCount);
|
getBuffer(useDirectBuffer(), bufLen * bufCount);
|
||||||
ByteBuffer buffer;
|
ByteBuffer buffer;
|
||||||
for (int i = 0; i < decodeInputs.length; i++) {
|
for (int i = 0; i < dataBlkNum; i++) {
|
||||||
buffer = codingBuffer.duplicate();
|
buffer = codingBuffer.duplicate();
|
||||||
decodeInputs[i] = new ECChunk(buffer, i * bufLen, bufLen);
|
decodeInputs[i] = new ECChunk(buffer, i * bufLen, bufLen);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue