Class CloudRequestAgent


  • public class CloudRequestAgent
    extends java.lang.Object
    Utility class to issue cloud requests with retries and throttling.
    • Constructor Summary

      Constructors 
      Constructor Description
      CloudRequestAgent​(com.github.ambry.config.CloudConfig cloudConfig, VcrMetrics vcrMetrics)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T doWithRetries​(java.util.concurrent.Callable<T> action, java.lang.String actionName, java.lang.String partitionPath)
      Execute an action up to the configured number of attempts.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CloudRequestAgent

        public CloudRequestAgent​(com.github.ambry.config.CloudConfig cloudConfig,
                                 VcrMetrics vcrMetrics)
    • Method Detail

      • doWithRetries

        public <T> T doWithRetries​(java.util.concurrent.Callable<T> action,
                                   java.lang.String actionName,
                                   java.lang.String partitionPath)
                            throws CloudStorageException
        Execute an action up to the configured number of attempts.
        Parameters:
        action - the Callable to call.
        actionName - the name of the action.
        partitionPath - the partition acted on.
        Returns:
        the return value of the action.
        Throws:
        CloudStorageException - if any error encountered in executing action.