>From Michael Blow <[email protected]>:

Michael Blow has uploaded this change for review. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21312?usp=email )


Change subject: [NO ISSUE][CLOUD] S3 Checksum Behavior Updates
......................................................................

[NO ISSUE][CLOUD] S3 Checksum Behavior Updates

- default S3 checksum behavior to 'auto' (i.e. SDK default)

Ext-ref: MB-72035
Change-Id: I6802f9769e553825886e255b1812758d321d00f7
---
M 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/CloudProperties.java
M 
hyracks-fullstack/hyracks/hyracks-cloud/src/main/java/org/apache/hyracks/cloud/io/S3ChecksumBehavior.java
2 files changed, 6 insertions(+), 10 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/12/21312/1

diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/CloudProperties.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/CloudProperties.java
index 2de95f6..85b0dd8 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/CloudProperties.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/CloudProperties.java
@@ -102,10 +102,7 @@
         CLOUD_STORAGE_S3_ACCESS_KEY_ID(STRING, (String) null),
         CLOUD_STORAGE_S3_SECRET_ACCESS_KEY(STRING, (String) null),
         CLOUD_STORAGE_AZURE_CLIENT_ID(STRING, (String) null),
-        CLOUD_STORAGE_S3_CHECKSUM_BEHAVIOR(STRING, 
(Function<IApplicationConfig, String>) app -> {
-            String endpoint = app.getString(CLOUD_STORAGE_ENDPOINT);
-            return 
S3ChecksumBehavior.defaultForEndpoint(endpoint).name().toLowerCase();
-        });
+        CLOUD_STORAGE_S3_CHECKSUM_BEHAVIOR(STRING, 
S3ChecksumBehavior.AUTO.stringValue());
 
         private final IOptionType interpreter;
         private final Object defaultValue;
@@ -250,9 +247,7 @@
                     return "The checksum behavior for S3 requests and 
responses. Accepted values: "
                             + "'when_required' (only checksums mandated by the 
operation), "
                             + "'when_supported' (checksums on all eligible 
operations, SDK >= 2.30 default), "
-                            + "'auto' (no explicit override, defer to SDK 
default). "
-                            + "Defaults to 'when_required' when a custom 
endpoint is configured "
-                            + "(S3-compatible stores), 'auto' for native AWS 
S3.";
+                            + "'auto' (no explicit override, defer to SDK 
default. " + "Defaults to 'auto'";
                 default:
                     throw new IllegalStateException("NYI: " + this);
             }
@@ -273,9 +268,6 @@
             if (this == CLOUD_STORAGE_S3_PARALLEL_DOWNLOADER_CLIENT_TYPE) {
                 return "crt if no custom endpoint is set; async otherwise";
             }
-            if (this == CLOUD_STORAGE_S3_CHECKSUM_BEHAVIOR) {
-                return "when_required if a custom endpoint is set; auto 
otherwise";
-            }
             return IOption.super.usageDefaultOverride(accessor, optionPrinter);
         }

diff --git 
a/hyracks-fullstack/hyracks/hyracks-cloud/src/main/java/org/apache/hyracks/cloud/io/S3ChecksumBehavior.java
 
b/hyracks-fullstack/hyracks/hyracks-cloud/src/main/java/org/apache/hyracks/cloud/io/S3ChecksumBehavior.java
index 0ab7e1b..788f75f 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-cloud/src/main/java/org/apache/hyracks/cloud/io/S3ChecksumBehavior.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-cloud/src/main/java/org/apache/hyracks/cloud/io/S3ChecksumBehavior.java
@@ -38,6 +38,10 @@
     /** Leave the SDK defaults untouched. Appropriate for native AWS S3. */
     AUTO;

+    public String stringValue() {
+        return name().toLowerCase();
+    }
+
     /** Parses the config string (case-insensitive). Returns {@code null} if 
the input is {@code null}. */
     public static S3ChecksumBehavior fromString(String s) {
         if (s == null) {

--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21312?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: asterixdb
Gerrit-Branch: lumina
Gerrit-Change-Id: I6802f9769e553825886e255b1812758d321d00f7
Gerrit-Change-Number: 21312
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Blow <[email protected]>

Reply via email to