Retry applied to temp storage.

This commit is contained in:
Abhishek Saharn 2024-01-08 15:51:34 +05:30
Родитель b6953e9a8b
Коммит b560bf8dbf
3 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -207,7 +207,7 @@ public class ResourceManager implements Closeable, IngestionResourceManager {
ResourceType resourceType = ResourceType.findByResourceTypeName(resourceTypeName);
switch (resourceType) {
case TEMP_STORAGE:
this.containers.addResource(new ContainerWithSas(storageUrl, httpClient));
this.containers.addResource(new ContainerWithSas(storageUrl, httpClient, this.queueRequestOptions));
break;
case INGESTIONS_STATUS_TABLE:
this.statusTable.addResource(new TableWithSas(storageUrl, httpClient));

Просмотреть файл

@ -3,7 +3,9 @@ package com.microsoft.azure.kusto.ingest.resources;
import com.azure.core.http.HttpClient;
import com.azure.storage.blob.BlobContainerClient;
import com.azure.storage.blob.BlobContainerClientBuilder;
import com.azure.storage.common.policy.RequestRetryOptions;
import com.microsoft.azure.kusto.data.UriUtils;
import reactor.util.annotation.Nullable;
import java.net.URISyntaxException;
@ -11,7 +13,7 @@ public class ContainerWithSas implements ResourceWithSas<BlobContainerClient> {
private final String sas;
private final BlobContainerClient container;
public ContainerWithSas(String url, HttpClient httpClient) throws URISyntaxException {
public ContainerWithSas(String url, HttpClient httpClient, @Nullable RequestRetryOptions retryOptions) throws URISyntaxException {
String[] parts = UriUtils.getSasAndEndpointFromResourceURL(url);
String endpoint = parts[0];
String sas = parts[1];
@ -21,6 +23,7 @@ public class ContainerWithSas implements ResourceWithSas<BlobContainerClient> {
.endpoint(endpoint)
.sasToken(sas)
.httpClient(httpClient)
.retryOptions(retryOptions)
.buildClient();
}

Просмотреть файл

@ -25,7 +25,7 @@ public class TestUtils {
static ContainerWithSas containerWithSasFromContainerName(String containerName) {
try {
return new ContainerWithSas(String.format("https://storage.blob.core.windows.net/%s?sas", containerName), null);
return new ContainerWithSas(String.format("https://storage.blob.core.windows.net/%s?sas", containerName), null, null);
} catch (URISyntaxException ex) {
return null;
}
@ -33,7 +33,7 @@ public class TestUtils {
static ContainerWithSas containerWithSasFromAccountNameAndContainerName(String accountName, String containerName) {
try {
return new ContainerWithSas(String.format("https://%s.blob.core.windows.net/%s?sas", accountName, containerName), null);
return new ContainerWithSas(String.format("https://%s.blob.core.windows.net/%s?sas", accountName, containerName), null, null);
} catch (URISyntaxException ex) {
return null;
}