[NO ISSUE][*DB][EXT] Update azure utils validation to accomodate Java 21
In Java 21, the URL ctor does (additional) validation of the URL than
was done previously- update the adapter setup logic to accommodate
failures when setting a malformed URL on the client builder
Ext-ref: MB-63101
Change-Id: I31ef40ad04861b7d45f661bcc5550687272f4b8e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19223
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
index 4860ed1..fb594b9 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
@@ -123,7 +123,11 @@
if (endpoint == null) {
throw new CompilationException(PARAMETERS_REQUIRED, ENDPOINT_FIELD_NAME);
}
- builder.endpoint(endpoint);
+ try {
+ builder.endpoint(endpoint);
+ } catch (Exception ex) {
+ throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex, getMessageOrToString(ex));
+ }
// Shared Key
if (accountName != null || accountKey != null) {
@@ -276,7 +280,11 @@
if (endpoint == null) {
throw new CompilationException(PARAMETERS_REQUIRED, ENDPOINT_FIELD_NAME);
}
- builder.endpoint(endpoint);
+ try {
+ builder.endpoint(endpoint);
+ } catch (Exception ex) {
+ throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, ex, getMessageOrToString(ex));
+ }
// Shared Key
if (accountName != null || accountKey != null) {