You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "farmmamba (Jira)" <ji...@apache.org> on 2023/07/13 09:24:00 UTC

[jira] [Created] (HDFS-17085) Erasure coding: readTo is computed large than actually needed during pread

farmmamba created HDFS-17085:
--------------------------------

             Summary: Erasure coding: readTo is computed large than actually needed during pread
                 Key: HDFS-17085
                 URL: https://issues.apache.org/jira/browse/HDFS-17085
             Project: Hadoop HDFS
          Issue Type: Improvement
          Components: erasure-coding
    Affects Versions: 3.4.0
            Reporter: farmmamba


In HDFS-16520,it improved EC pread by introducing a readTo field.

But, the way it was calculated seems still have some room for improvement.

Now, it was calculated by below code:
{code:java}
for (AlignedStripe stripe : stripes) {
  readTo = Math.max(readTo, stripe.getOffsetInBlock() + stripe.getSpanInBlock());
} {code}
But in the followed code, for every AlignedStripe object, it uses max readTo to construct StripeReader. I think there still exists waste of resource.
{code:java}
for (AlignedStripe stripe : stripes) {
  // Parse group to get chosen DN location
  StripeReader preader = new PositionStripeReader(stripe, ecPolicy, blks,
      preaderInfos, corruptedBlocks, decoder, this);
  preader.setReadTo(readTo);
  try {
    preader.readStripe();
  } finally {
    preader.close();
  }
} {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org