public boolean shouldRetry()

in src/main/java/com/microsoft/azure/datalake/store/retrypolicies/NonIdempotentRetryPolicy.java [29:50]


    public boolean shouldRetry(int httpResponseCode, Exception lastException) {
        if (httpResponseCode == 401 && retryCount401 == 0) {
            // this could be because of call delay. Just retry once, in hope of token being renewed by now
            wait(waitInterval);
            retryCount401++;
            return true;
        }

        if (httpResponseCode == 429) {
            // 429 means that the backend did not change any state.
            if (retryCount429 < maxRetries) {
                wait(exponentialRetryInterval);
                exponentialRetryInterval *= exponentialFactor;
                retryCount429++;
                return true;
            } else {
                return false;  // max # of retries exhausted
            }
        }

        return false;
    }