Stephen O'Donnell created HDDS-6424:
---------------------------------------
Summary: KeyInputStream should create BlockStreams lazily
Key: HDDS-6424
URL: https://issues.apache.org/jira/browse/HDDS-6424
Project: Apache Ozone
Issue Type: Improvement
Reporter: Stephen O'Donnell
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).
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]