Skip to content

Commit

Permalink
Upgrade Azure Blobstore fromi legacy azure-sdk (11.0) to latest (12.2…
Browse files Browse the repository at this point in the history
…7.0)

Add azure storage blob 12.27.1 dependencies and upgrade the
azure blobstore.

Run Azurite-based integration tests against the latest Docker image
version, remove legacy.

Migrate to `com.azure:blobstorage:12.x`. The upgrade
tries to do a 1:1 migration to the new azure-sdk API (in its blocking
falvor) as much as possible, so that the integration tests serve to
avoid regressions.

A couple remarks:

* There's no way to close the HTTPClient so AzureClient does not
  implement Closeable anymore.
* Fix a bug in DeleteManager that always reported 0 objects deleted

Upgrade `com.microsoft.azure:azure-storage-blob` to
`com.azure:azure-storage-blob`.
  • Loading branch information
groldan committed Sep 16, 2024
1 parent 6d10d9f commit ad540d8
Show file tree
Hide file tree
Showing 15 changed files with 474 additions and 905 deletions.
25 changes: 22 additions & 3 deletions geowebcache/azureblob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@
<groupId>org.geowebcache</groupId>
<artifactId>gwc-azure-blob</artifactId>

<properties>
<!-- Same sdk version as imageio-ext's cog-ragengereader-azure for GeoSever compatibility -->
<azure.version>12.27.1</azure.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<!--
Use the same netty version as imageio-ext's cog-ragengereader-s3 and cog-rangereader-azure
See https://github.com/geosolutions-it/imageio-ext/pull/312
-->
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
<version>4.1.113.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.geowebcache</groupId>
Expand All @@ -19,10 +39,9 @@
</dependency>

<dependency>
<groupId>com.microsoft.azure</groupId>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<!-- at the time of writing 11.0.1 was available but pom on repoes was corrupted -->
<version>11.0.0</version>
<version>${azure.version}</version>
</dependency>

<dependency>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class AzureBlobStoreData {
private String accountName;
private String accountKey;
private Integer maxConnections;
private Boolean useHTTPS;
private boolean useHTTPS;
private String proxyHost;
private Integer proxyPort;
private String proxyUsername;
Expand Down Expand Up @@ -113,11 +113,11 @@ public void setMaxConnections(Integer maxConnections) {
this.maxConnections = maxConnections;
}

public Boolean isUseHTTPS() {
public boolean isUseHTTPS() {
return useHTTPS;
}

public void setUseHTTPS(Boolean useHTTPS) {
public void setUseHTTPS(boolean useHTTPS) {
this.useHTTPS = useHTTPS;
}

Expand All @@ -137,6 +137,7 @@ public void setProxyPort(Integer proxyPort) {
this.proxyPort = proxyPort;
}

/** unused */
public String getProxyUsername() {
return proxyUsername;
}
Expand All @@ -145,6 +146,7 @@ public void setProxyUsername(String proxyUsername) {
this.proxyUsername = proxyUsername;
}

/** unused */
public String getProxyPassword() {
return proxyPassword;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class AzureBlobStoreInfo extends BlobStoreInfo {

private String maxConnections;

private Boolean useHTTPS = true;
private boolean useHTTPS = true;

private String proxyHost;

Expand Down Expand Up @@ -139,7 +139,7 @@ public Boolean isUseHTTPS() {
}

/** @param useHTTPS whether to use HTTPS (true) or HTTP (false) when talking to Azure */
public void setUseHTTPS(Boolean useHTTPS) {
public void setUseHTTPS(boolean useHTTPS) {
this.useHTTPS = useHTTPS;
}

Expand Down Expand Up @@ -260,7 +260,7 @@ public int hashCode() {
result = prime * result + ((proxyPort == null) ? 0 : proxyPort.hashCode());
result = prime * result + ((proxyUsername == null) ? 0 : proxyUsername.hashCode());
result = prime * result + ((serviceURL == null) ? 0 : serviceURL.hashCode());
result = prime * result + ((useHTTPS == null) ? 0 : useHTTPS.hashCode());
result = prime * result + (useHTTPS ? 1 : 0);
return result;
}

Expand Down Expand Up @@ -300,9 +300,7 @@ public boolean equals(Object obj) {
if (serviceURL == null) {
if (other.serviceURL != null) return false;
} else if (!serviceURL.equals(other.serviceURL)) return false;
if (useHTTPS == null) {
if (other.useHTTPS != null) return false;
} else if (!useHTTPS.equals(other.useHTTPS)) return false;
if (useHTTPS != other.useHTTPS) return false;
return true;
}

Expand Down
Loading

0 comments on commit ad540d8

Please sign in to comment.