Package com.github.ambry.cloud
Class CloudRequestAgent
- java.lang.Object
-
- com.github.ambry.cloud.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.
-
-
-
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
- theCallable
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.
-
-