maytasm3 commented on a change in pull request #9375: Add support for optional
aws credentials for s3 for ingestion
URL: https://github.com/apache/druid/pull/9375#discussion_r384169996
##########
File path:
extensions-core/s3-extensions/src/main/java/org/apache/druid/data/input/s3/S3InputSource.java
##########
@@ -42,32 +46,66 @@
import java.net.URI;
import java.util.Iterator;
import java.util.List;
+import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class S3InputSource extends CloudObjectInputSource
{
- private final ServerSideEncryptingAmazonS3 s3Client;
+ // We lazily initialize ServerSideEncryptingAmazonS3 to avoid costly s3
operation when we only need S3InputSource
+ // for stored information (such as for task logs) and not for ingestion.
+ // (This cost only applies for new ServerSideEncryptingAmazonS3 created with
s3InputSourceProperties given).
+ private final Supplier<ServerSideEncryptingAmazonS3> s3ClientSupplier;
+ @JsonProperty("properties")
+ private final S3InputSourceProperties s3InputSourceProperties;
private final S3InputDataConfig inputDataConfig;
@JsonCreator
public S3InputSource(
@JacksonInject ServerSideEncryptingAmazonS3 s3Client,
Review comment:
Yea..we still need it to use the singleton client for when the properties is
not present in the JSON. This will save the cost of initializing the s3client
using the s3ClientSupplier since we can reuse the injected singleton
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]