jackye1995 commented on code in PR #12299: URL: https://github.com/apache/iceberg/pull/12299#discussion_r1962198159
########## 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: Since we already have an input stream factory, I think we could avoid having a branching logic when creating a new stream. Instead, the default input stream factory would just be using the `S3Client` to create a new input stream. Only when the flag is enabled, you use a different input stream factory. -- 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