commit | ab0abc111eaa663f9115756ba4e7cbf1da1c5f3b | [log] [tgz] |
---|---|---|
author | Hussain Towaileb <Hussain.Towaileb@couchbase.com> | Sat Apr 13 06:14:10 2024 +0300 |
committer | Hussain Towaileb <hussainht@gmail.com> | Fri Apr 19 06:11:14 2024 +0000 |
tree | 32c0febb816704e9eebb398b4f9631b7e606073b | |
parent | 9340d8c44d594829c1761700c24436b70ec9241a [diff] |
[ASTERIXDB-3378][EXT]: Allow user to opt out of validating write permission before COPY TO S3 Change-Id: Ie099710714e032674727d0cb426cc450d8dda167 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18234 Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Reviewed-by: Hussain Towaileb <hussainht@gmail.com>
diff --git a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/writer/S3ExternalFileWriterFactory.java b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/writer/S3ExternalFileWriterFactory.java index 5faa8e1..cdaa6dc 100644 --- a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/writer/S3ExternalFileWriterFactory.java +++ b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/writer/S3ExternalFileWriterFactory.java
@@ -151,6 +151,13 @@ } } + // do not validate write permissions if specified by the user not to do so + String validateWritePermissions = configuration + .getOrDefault(ExternalDataConstants.KEY_VALIDATE_WRITE_PERMISSION, Boolean.TRUE.toString()); + if (!Boolean.parseBoolean(validateWritePermissions)) { + return; + } + Random random = new Random(); String pathPrefix = "testFile"; String path = pathPrefix + random.nextInt();
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java index fcdddd8..98ccbce 100644 --- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java +++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
@@ -310,6 +310,7 @@ * Writer Constants */ public static final String KEY_WRITER_MAX_RESULT = "max-objects-per-file"; + public static final String KEY_VALIDATE_WRITE_PERMISSION = "validate-write-permission"; public static final String KEY_WRITER_COMPRESSION = "compression"; public static final int WRITER_MAX_RESULT_DEFAULT = 10000; public static final int WRITER_MAX_RESULT_MINIMUM = 1000;