github-code-scanning[bot] commented on code in PR #14834:
URL: https://github.com/apache/druid/pull/14834#discussion_r1304747974


##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3StorageConnector.java:
##########
@@ -52,18 +54,51 @@
 public class S3StorageConnector extends 
ChunkingStorageConnector<GetObjectRequest>
 {
   private static final Logger log = new Logger(S3StorageConnector.class);
+  private static final int DOWNLOAD_PARALLELISM = 4;
 
   private final S3OutputConfig config;
   private final ServerSideEncryptingAmazonS3 s3Client;
 
   private static final String DELIM = "/";
   private static final Joiner JOINER = Joiner.on(DELIM).skipNulls();
   private static final int MAX_NUMBER_OF_LISTINGS = 1000;
+  private static final long DOWNLOAD_SIZE_BYTES = 32 * 1024 * 1024;
+
+  private static final long UPLOAD_CHUNK_SIZE = 8 * 1024 * 1024L;
+
+  // cacheLocally is old behaviour
+  // private final boolean cacheLocally;
 
   public S3StorageConnector(S3OutputConfig config, 
ServerSideEncryptingAmazonS3 serverSideEncryptingAmazonS3)
   {
+    this(
+        config,
+        serverSideEncryptingAmazonS3,
+        // config.getChunkSize(),
+        !(config.isTestingTransferManager())
+    );
+  }
+
+  private S3StorageConnector(
+      S3OutputConfig config,
+      ServerSideEncryptingAmazonS3 serverSideEncryptingAmazonS3,
+      // long uploadChunkSize,
+      boolean cacheLocally
+  )
+  {
+    super(
+        cacheLocally ? config.getChunkSize() : DOWNLOAD_PARALLELISM * 
DOWNLOAD_SIZE_BYTES,
+        cacheLocally
+    );
+    // this.uploadChunkSize = uploadChunkSize;
+    // this.cacheLocally = cacheLocally;
     this.config = config;
     this.s3Client = serverSideEncryptingAmazonS3;
+
+    TransferManager transferManager = TransferManagerBuilder.standard()
+                                                            
.withS3Client(serverSideEncryptingAmazonS3.getUnderlyingS3Client())
+                                                            .build();

Review Comment:
   ## Unread local variable
   
   Variable 'TransferManager transferManager' is never read.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/5731)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to