[ https://issues.apache.org/jira/browse/HADOOP-19394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18010911#comment-18010911 ]
ASF GitHub Bot commented on HADOOP-19394: ----------------------------------------- ahmarsuhail commented on code in PR #7720: URL: https://github.com/apache/hadoop/pull/7720#discussion_r2242680859 ########## hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/streams/AnalyticsStream.java: ########## @@ -128,6 +141,48 @@ public int read(byte[] buf, int off, int len) throws IOException { return bytesRead; } + /** + * {@inheritDoc} + * Pass to {@link #readVectored(List, IntFunction, Consumer)} + * with the {@link VectoredReadUtils#LOG_BYTE_BUFFER_RELEASED} releaser. + * @param ranges the byte ranges to read. + * @param allocate the function to allocate ByteBuffer. + * @throws IOException IOE if any. + */ + @Override + public void readVectored(List<? extends FileRange> ranges, + IntFunction<ByteBuffer> allocate) throws IOException { + readVectored(ranges, allocate, LOG_BYTE_BUFFER_RELEASED); + } + + /** + * {@inheritDoc} + * Pass to {@link #readVectored(List, IntFunction, Consumer)} + * with the {@link VectoredReadUtils#LOG_BYTE_BUFFER_RELEASED} releaser. + * @param ranges the byte ranges to read. + * @param allocate the function to allocate ByteBuffer. + * @throws IOException IOE if any. + */ + @Override + public void readVectored(final List<? extends FileRange> ranges, + final IntFunction<ByteBuffer> allocate, + final Consumer<ByteBuffer> release) throws IOException { + LOG.debug("AAL: Starting vectored read on path {} for ranges {} ", getPathStr(), ranges); + throwIfClosed(); + + List<ObjectRange> objectRanges = new ArrayList<>(); + + for (FileRange range : ranges) { + CompletableFuture<ByteBuffer> result = new CompletableFuture<>(); + ObjectRange objectRange = new ObjectRange(result, range.getOffset(), range.getLength()); + objectRanges.add(objectRange); + range.setData(result); + } + + // AAL does not do any range coalescing, so input and combined ranges are the same. + this.getS3AStreamStatistics().readVectoredOperationStarted(ranges.size(), ranges.size()); + inputStream.readVectored(objectRanges, allocate, release); Review Comment: ah no :( release isn't called right now, but will make that change and get it released in the next version > S3A Analytics Accelerator: vector IO support > -------------------------------------------- > > Key: HADOOP-19394 > URL: https://issues.apache.org/jira/browse/HADOOP-19394 > Project: Hadoop Common > Issue Type: Sub-task > Components: fs/s3 > Affects Versions: 3.4.1 > Reporter: Steve Loughran > Priority: Major > Labels: pull-request-available > > Add vector IO support for analytics accelerator stream > Three stages > # pull up s3a input stream to work with all ObjectInputStreams; do its own > fetching independent of the analytics stream > # provide info to stream of fetches having taken place (remove from cache, > cancel prefetch) > full integration > * return a range from cache if present > * append to the block retrieval callback if a prefetch is in progress > * only do merge + new request if the range cannot be satisifed entirely from > cached data > Out of scope: handling case where part of a range is in cache/retrieval. Too > complicated and so prone to problems. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org