Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-6424

KeyInputStream should create BlockStreams lazily

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      In KeyInputStream, when the object is initialized, it pre-creates a BlockInputStream for every block in the Key. If the key is very large, this can be a lot of streams. For the Ratis read case, the BlockInputStream objects are lightweight and they don't setup the block read until they are read for the first time. However this is not the case with the EC readers, which allocate buffers and some resources when they are allocated.

      Additionally, when the KeyInputStream has read past a given block it does not close the previous stream. So even if the EC readers delayed allocation until first read, the resources will not be freed by close until after the Key has been read completely.

      We should make KeyInputStream open the Block stream on demand, and close it after its read position has moved outside the current block (either by seek or normal reads).

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            sodonnell Stephen O'Donnell

            Dates

              Created:
              Updated:

              Slack

                Issue deployment