ivankelly commented on a change in pull request #1746: PIP-17: impl offload() 
for S3ManagedLedgerOffloader
URL: https://github.com/apache/incubator-pulsar/pull/1746#discussion_r187596277
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/s3offload/S3ManagedLedgerOffloader.java
 ##########
 @@ -60,28 +77,96 @@ public static S3ManagedLedgerOffloader 
create(ServiceConfiguration conf,
         } else {
             builder.setRegion(region);
         }
-        return new S3ManagedLedgerOffloader(builder.build(), bucket, 
scheduler);
+        return new S3ManagedLedgerOffloader(builder.build(), bucket, 
scheduler, maxBlockSize);
     }
 
-    S3ManagedLedgerOffloader(AmazonS3 s3client, String bucket, 
ScheduledExecutorService scheduler) {
+    S3ManagedLedgerOffloader(AmazonS3 s3client, String bucket, 
ScheduledExecutorService scheduler, int maxBlockSize) {
         this.s3client = s3client;
         this.bucket = bucket;
         this.scheduler = scheduler;
+        this.maxBlockSize = maxBlockSize;
     }
 
+    static String dataBlockOffloadKey(ReadHandle readHandle, UUID uuid) {
+        return String.format("ledger-%d-%s", readHandle.getId(), 
uuid.toString());
+    }
+
+    static String indexBlockOffloadKey(ReadHandle readHandle, UUID uuid) {
+        return String.format("ledger-%d-%s-index", readHandle.getId(), 
uuid.toString());
+    }
+
+    // upload DataBlock to s3 using MultiPartUpload, and indexBlock in a new 
Block,
+    // because the smallest size for MultiPartUpload is 5MB, which is too big 
for it at present.
 
 Review comment:
   I would remove this comment. It's not rely relevant anymore.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to