You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/05/23 08:21:41 UTC

[GitHub] [pulsar] zymap opened a new pull request, #15710: [improve] [tiered-storage] Add pure S3 provider for the offloader

zymap opened a new pull request, #15710:
URL: https://github.com/apache/pulsar/pull/15710

   
   
   ### Motivation
   
   
   There have some cloud storages are compatible with S3
   APIs, such as aliyun-oss. Some other storages also use
   the S3 APIs and want to offload the data into them, but
   we only support the AWS or the Aliyun.
   The PR https://github.com/apache/pulsar/pull/8985 provides
   the Aliyun offload provider, but it has a force limitation of
   the `S3Constants.PROPERTY_S3_VIRTUAL_HOST_BUCKETS`. That
   is not a limitation on other storage services which compatible
   with S3 APIs.
   This PR provides  a more general offload provider `S3` which uses
   pure JClouds S3 metadata and allows people to override the
   default JClouds properties through system properties.
   
   
   ### Modifications
   
   - Add the pure S3 offload provider
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API: (yes / no)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
     - The rest endpoints: (yes / no)
     - The admin cli options: (yes / no)
     - Anything that affects deployment: (yes / no / don't know)
   
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   
   - [x] `doc-required` 
   (Your PR needs to update docs and you will update later)
     
   - [ ] `no-need-doc` 
   (Please explain why)
     
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-added`
   (Docs have been already added)


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] zymap commented on a diff in pull request #15710: [feat] [tiered-storage] Add pure S3 provider for the offloader

Posted by GitBox <gi...@apache.org>.
zymap commented on code in PR #15710:
URL: https://github.com/apache/pulsar/pull/15710#discussion_r880106334


##########
tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/TieredStorageConfiguration.java:
##########
@@ -329,6 +329,13 @@ protected Properties getOverrides() {
             overrides.setProperty(S3Constants.PROPERTY_S3_VIRTUAL_HOST_BUCKETS, "false");
         }
 
+        // load more jclouds properties into the overrides
+        System.getProperties().entrySet().stream()

Review Comment:
   Add both of them.



##########
tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java:
##########
@@ -409,14 +428,21 @@ public String getAWSSecretKey() {
         }
     };
 
-    static final CredentialBuilder ALIYUN_OSS_CREDENTIAL_BUILDER = (TieredStorageConfiguration config) -> {
-        String accountName = System.getenv("ALIYUN_OSS_ACCESS_KEY_ID");
-        if (StringUtils.isEmpty(accountName)) {
-            throw new IllegalArgumentException("Couldn't get the aliyun oss access key id.");
+    static final CredentialBuilder S3_CREDENTIAL_BUILDER = (TieredStorageConfiguration config) -> {
+        String accountName = System.getenv("ACCESS_KEY_ID");
+        // For forward compatibility
+        if (StringUtils.isEmpty(accountName.trim())) {

Review Comment:
   Fixed



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] zymap commented on a diff in pull request #15710: [feat] [tiered-storage] Add pure S3 provider for the offloader

Posted by GitBox <gi...@apache.org>.
zymap commented on code in PR #15710:
URL: https://github.com/apache/pulsar/pull/15710#discussion_r880009016


##########
tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java:
##########
@@ -409,14 +428,21 @@ public String getAWSSecretKey() {
         }
     };
 
-    static final CredentialBuilder ALIYUN_OSS_CREDENTIAL_BUILDER = (TieredStorageConfiguration config) -> {
-        String accountName = System.getenv("ALIYUN_OSS_ACCESS_KEY_ID");
-        if (StringUtils.isEmpty(accountName)) {
-            throw new IllegalArgumentException("Couldn't get the aliyun oss access key id.");
+    static final CredentialBuilder S3_CREDENTIAL_BUILDER = (TieredStorageConfiguration config) -> {
+        String accountName = System.getenv("ACCESS_KEY_ID");
+        // For forward compatibility
+        if (StringUtils.isEmpty(accountName.trim())) {

Review Comment:
   StringUtils.isEmpty will check null value



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] zymap merged pull request #15710: [feat] [tiered-storage] Add pure S3 provider for the offloader

Posted by GitBox <gi...@apache.org>.
zymap merged PR #15710:
URL: https://github.com/apache/pulsar/pull/15710


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] hangc0276 commented on a diff in pull request #15710: [feat] [tiered-storage] Add pure S3 provider for the offloader

Posted by GitBox <gi...@apache.org>.
hangc0276 commented on code in PR #15710:
URL: https://github.com/apache/pulsar/pull/15710#discussion_r880005350


##########
tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java:
##########
@@ -409,14 +428,21 @@ public String getAWSSecretKey() {
         }
     };
 
-    static final CredentialBuilder ALIYUN_OSS_CREDENTIAL_BUILDER = (TieredStorageConfiguration config) -> {
-        String accountName = System.getenv("ALIYUN_OSS_ACCESS_KEY_ID");
-        if (StringUtils.isEmpty(accountName)) {
-            throw new IllegalArgumentException("Couldn't get the aliyun oss access key id.");
+    static final CredentialBuilder S3_CREDENTIAL_BUILDER = (TieredStorageConfiguration config) -> {
+        String accountName = System.getenv("ACCESS_KEY_ID");
+        // For forward compatibility
+        if (StringUtils.isEmpty(accountName.trim())) {

Review Comment:
   It will throw NPE when `accountName` is null. The same below.



##########
tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/TieredStorageConfiguration.java:
##########
@@ -329,6 +329,13 @@ protected Properties getOverrides() {
             overrides.setProperty(S3Constants.PROPERTY_S3_VIRTUAL_HOST_BUCKETS, "false");
         }
 
+        // load more jclouds properties into the overrides
+        System.getProperties().entrySet().stream()

Review Comment:
   `System.getenv()` instead of `System.getProperties()` ?



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] momo-jun commented on pull request #15710: [feat] [tiered-storage] Add pure S3 provider for the offloader

Posted by GitBox <gi...@apache.org>.
momo-jun commented on PR #15710:
URL: https://github.com/apache/pulsar/pull/15710#issuecomment-1139209290

   #### Doc status update
   @zymap will add docs for this new provider soon.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org