public abstract class RetryPolicy extends Object implements RetryPolicyFactory
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CLIENT_BACKOFF
Represents the default client backoff interval, in milliseconds.
|
static int |
DEFAULT_CLIENT_RETRY_COUNT
Represents the default client retry count.
|
static int |
DEFAULT_MAX_BACKOFF
Represents the default maximum backoff interval, in milliseconds.
|
static int |
DEFAULT_MIN_BACKOFF
Represents the default minimum backoff interval, in milliseconds.
|
Constructor and Description |
---|
RetryPolicy()
Creates an instance of the
RetryPolicy class. |
RetryPolicy(int deltaBackoff,
int maxAttempts)
Creates an instance of the
RetryPolicy class using the specified delta backoff and maximum retry
attempts. |
Modifier and Type | Method and Description |
---|---|
abstract RetryInfo |
evaluate(RetryContext retryContext,
OperationContext operationContext)
Determines whether the operation should be retried and specifies the interval until the next retry.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createInstance
public static final int DEFAULT_CLIENT_BACKOFF
public static final int DEFAULT_CLIENT_RETRY_COUNT
public static final int DEFAULT_MAX_BACKOFF
public static final int DEFAULT_MIN_BACKOFF
public RetryPolicy()
RetryPolicy
class.public RetryPolicy(int deltaBackoff, int maxAttempts)
RetryPolicy
class using the specified delta backoff and maximum retry
attempts.deltaBackoff
- The backoff interval, in milliseconds, between retries.maxAttempts
- The maximum number of retry attempts.public abstract RetryInfo evaluate(RetryContext retryContext, OperationContext operationContext)
retryContext
- A RetryContext
object that indicates the number of retries, last request's results, whether
the next retry should happen in the primary or secondary location, and specifies the location mode.operationContext
- An OperationContext
object for tracking the current operation.RetryInfo
object that indicates whether the next retry will happen in the primary or secondary
location, and specifies the location mode. If null
, the operation will not be retried./**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/