geruh commented on code in PR #12299: URL: https://github.com/apache/iceberg/pull/12299#discussion_r1960726499
########## aws/src/main/java/org/apache/iceberg/aws/s3/analyticsaccelerator/S3SeekableInputStreamFactorySupplier.java: ########## @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.iceberg.aws.s3.analyticsaccelerator; + +import java.util.Map; +import org.apache.iceberg.aws.s3.S3FileIOProperties; +import org.apache.iceberg.util.SerializableSupplier; +import software.amazon.awssdk.services.s3.S3AsyncClient; +import software.amazon.s3.analyticsaccelerator.ObjectClientConfiguration; +import software.amazon.s3.analyticsaccelerator.S3SdkObjectClient; +import software.amazon.s3.analyticsaccelerator.S3SeekableInputStreamConfiguration; +import software.amazon.s3.analyticsaccelerator.S3SeekableInputStreamFactory; +import software.amazon.s3.analyticsaccelerator.common.ConnectorConfiguration; +import software.amazon.s3.analyticsaccelerator.request.ObjectClient; + +public class S3SeekableInputStreamFactorySupplier + implements SerializableSupplier<S3SeekableInputStreamFactory> { + + private final Map<String, String> s3AnalyticsAccelaratorProperties; + + public S3SeekableInputStreamFactorySupplier(S3FileIOProperties s3FileIOProperties) { + this.s3AnalyticsAccelaratorProperties = + s3FileIOProperties.getS3AnalyticsacceleratorConfiguration(); + } + + @Override + public S3SeekableInputStreamFactory get() { + ConnectorConfiguration connectorConfiguration = + new ConnectorConfiguration(s3AnalyticsAccelaratorProperties); + S3SeekableInputStreamConfiguration streamConfiguration = + S3SeekableInputStreamConfiguration.fromConfiguration(connectorConfiguration); + ObjectClientConfiguration objectClientConfiguration = + ObjectClientConfiguration.fromConfiguration(connectorConfiguration); + + ObjectClient objectClient = + new S3SdkObjectClient( Review Comment: What do you think about following the same pattern we use for aws clients. We'd definitely need parity for the configurations between this and the existing s3 client. example: https://github.com/apache/iceberg/blob/main/aws/src/main/java/org/apache/iceberg/aws/lakeformation/LakeFormationAwsClientFactory.java https://github.com/apache/iceberg/blob/main/aws/src/main/java/org/apache/iceberg/aws/AwsClientProperties.java -- 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