mirror of
https://github.com/apache/druid.git
synced 2025-02-22 18:30:13 +00:00
adjust azure storage retry conditions (#8296)
This commit is contained in:
parent
c8d7e0a868
commit
7fa0ff5e11
@ -30,29 +30,23 @@ import java.net.URISyntaxException;
|
||||
public class AzureUtils
|
||||
{
|
||||
|
||||
|
||||
public static final Predicate<Throwable> AZURE_RETRY = new Predicate<Throwable>()
|
||||
{
|
||||
@Override
|
||||
public boolean apply(Throwable e)
|
||||
{
|
||||
if (e instanceof URISyntaxException) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e instanceof IOException) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e instanceof StorageException) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final Predicate<Throwable> AZURE_RETRY = e -> {
|
||||
if (e instanceof URISyntaxException) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e instanceof StorageException) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (e instanceof IOException) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
public static <T> T retryAzureOperation(Task<T> f, int maxTries) throws Exception
|
||||
static <T> T retryAzureOperation(Task<T> f, int maxTries) throws Exception
|
||||
{
|
||||
return RetryUtils.retry(f, AZURE_RETRY, maxTries);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user