SanjayMarreddi commented on code in PR #12299: URL: https://github.com/apache/iceberg/pull/12299#discussion_r1968199157
########## aws/src/main/java/org/apache/iceberg/aws/s3/S3InputFile.java: ########## @@ -82,6 +97,27 @@ public long getLength() { @Override public SeekableInputStream newStream() { + if (s3FileIOProperties().isS3AnalyticsAcceleratorEnabled()) { + LOG.info("Using S3 analytics accelerator stream"); + LOG.info("S3 analytics accelerator configuration: {}", streamFactory().getConfiguration()); + try { + final ObjectMetadata metadata = + ObjectMetadata.builder() + .contentLength(getObjectMetadata().contentLength()) + .etag(getObjectMetadata().eTag()) + .build(); + return new AnalyticsAcceleratorInputStream( + streamFactory() + .createStream( + software.amazon.s3.analyticsaccelerator.util.S3URI.of( + uri().bucket(), uri().key()), + metadata)); + } catch (IOException e) { + throw new RuntimeIOException( + "Failed to create analytics accelerator input stream for bucket: %s, key: %s - %s", + uri().bucket(), uri().key(), e); + } + } return new S3InputStream(client(), uri(), s3FileIOProperties(), metrics()); Review Comment: Yeah, I'm updating this logic now to avoid branching. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org