All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.inlong.sort.filesystem.shaded.com.amazonaws.retry.RetryMode Maven / Gradle / Ivy

There is a newer version: 1.13.0
Show newest version
/*
 * Copyright 2011-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * 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://aws.amazon.com/apache2.0
 *
 * This file 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.
 */

package com.amazonaws.retry;

/**
 * The retry mode
 */
public enum RetryMode {

    /**
     * The legacy mode that only enables throttled retry for transient errors
     */
    LEGACY("legacy"),

    /**
     * Standard mode is built on top of legacy mode and has throttled retry enabled for throttling errors apart from transient
     * errors. In addition, timeout(socket timeout or connection timeout) errors would cost more retry capacity compared with
     * {@link #LEGACY}.
     */
    STANDARD("standard"),

    /**
     * Adaptive retry mode dynamically limits the rate of AWS requests to maximize success rate. This may be at the
     * expense of request latency. Adaptive retry mode is not recommended when predictable latency is important. 
     * 

* Warning: Adaptive retry mode assumes that the client is working against a single resource (e.g. one * DynamoDB Table or one S3 Bucket). If you use a single client for multiple resources, throttling or outages * associated with one resource will result in increased latency and failures when accessing all other resources via * the same client. When using adaptive retry mode, we recommend using a single client per resource. * * @see RetryPolicy#isFastFailRateLimiting() */ ADAPTIVE("adaptive") ; private final String name; RetryMode(String name) { this.name = name; } public String getName() { return name; } /** * Returns a retry mode enum corresponding to the given retryMode name. * * @param value The name of the retry mode * @return RetryMode enum representing the given retry mode name. */ public static RetryMode fromName(String value) { if (value == null) { return null; } for (RetryMode retryMode : RetryMode.values()) { if (retryMode.getName().equalsIgnoreCase(value)) { return retryMode; } } return null; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy