You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/09/29 16:09:00 UTC

[jira] [Commented] (HADOOP-18378) Implement readFully(long position, byte[] buffer, int offset, int length)

    [ https://issues.apache.org/jira/browse/HADOOP-18378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17611111#comment-17611111 ] 

ASF GitHub Bot commented on HADOOP-18378:
-----------------------------------------

passaro opened a new pull request, #4955:
URL: https://github.com/apache/hadoop/pull/4955

   ### Description of PR
   
   [HADOOP-18378](https://issues.apache.org/jira/browse/HADOOP-18378). Make S3APrefetchingInputStream.seek() completely lazy. Calls to seek() will not affect the current buffer nor interfere with prefetching, until read() is called. This change allows various usage patterns to benefit from prefetching, e.g. when calling readFully(position, buffer) in a loop for contiguous positions, the intermediate internal calls to seek() will be noops and prefetching will have the same performance as in a sequential read.
   
   ### How was this patch tested?
   
   Tested with `mvn clean verify` on a bucket in `eu-west-2`.
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
   - [x] Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files?
   
   




> Implement readFully(long position, byte[] buffer, int offset, int length)
> -------------------------------------------------------------------------
>
>                 Key: HADOOP-18378
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18378
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/s3
>    Affects Versions: 3.4.0
>            Reporter: Ahmar Suhail
>            Assignee: Alessandro Passaro
>            Priority: Minor
>
> Implement readFully(long position, byte[] buffer, int offset, int length) in PrefetchingInputStream, as it currently uses FSInputStream's [readFully|https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSInputStream.java#L136] which calls read(long position, byte[] buffer, int offset, int length).
> This read then seeks to the position (which is ok), but then seeks back to the original starting position at the end (so always seeking back to 0). this is pretty bad for the prefetching implementation as it means lots of caching to disk and getting blocks from disk. 



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

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