org.apache.hadoop.hdfs.util

## Class StripedBlockUtil.AlignedStripe

- java.lang.Object
- - org.apache.hadoop.hdfs.util.StripedBlockUtil.AlignedStripe

- Enclosing class:
    org.apache.hadoop.hdfs.util.StripedBlockUtil

      public static class StripedBlockUtil.AlignedStripe
      extends Object

  Given a requested byte range on a striped block group, an AlignedStripe represents an inclusive `StripedBlockUtil.VerticalRange` that is aligned with both the byte range and boundaries of all internal blocks. As illustrated in the diagram, any given byte range on a block group leads to 1~5 AlignedStripe's. An AlignedStripe is the basic unit of reading from a striped block group, because within the AlignedStripe, all internal blocks can be processed in a uniform manner. The coverage of an AlignedStripe on an internal block is represented as a `StripedBlockUtil.StripingChunk`. To simplify the logic of reading a logical byte range from a block group, a StripingChunk is either completely in the requested byte range or completely outside the requested byte range.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `StripedBlockUtil.StripingChunk[]` | `chunks` status of each chunk in the stripe.
    `int` | `fetchedChunksNum`
    `int` | `missingChunksNum`
    `StripedBlockUtil.VerticalRange` | `range`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AlignedStripe(long offsetInBlock, long length, int width)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getOffsetInBlock()`
    `long` | `getSpanInBlock()`
    `boolean` | `include(long pos)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### range

          public StripedBlockUtil.VerticalRange range

    - #### chunks

          public final StripedBlockUtil.StripingChunk[] chunks

      status of each chunk in the stripe.

    - #### fetchedChunksNum

          public int fetchedChunksNum

    - #### missingChunksNum

          public int missingChunksNum

  - ### Constructor Detail

    - #### AlignedStripe

          public AlignedStripe(long offsetInBlock,
                               long length,
                               int width)

  - ### Method Detail

    - #### include

          public boolean include(long pos)

    - #### getOffsetInBlock

          public long getOffsetInBlock()

    - #### getSpanInBlock

          public long getSpanInBlock()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.