Package io.trino.plugin.hive.aws
Class AwsCurrentRegionHolder
- java.lang.Object
-
- io.trino.plugin.hive.aws.AwsCurrentRegionHolder
-
public final class AwsCurrentRegionHolder extends Object
Caches the result of callingRegions.getCurrentRegion()since accessing EC2 instance metadata repeatedly can result in being throttled and prevent other metadata accessing operations such as refreshing instance credentials from working normally
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.amazonaws.regions.RegiongetCurrentRegionFromEC2Metadata()Attempts to resolve the current region from EC2's instance metadata throughRegions.getCurrentRegion().
-
-
-
Method Detail
-
getCurrentRegionFromEC2Metadata
public static com.amazonaws.regions.Region getCurrentRegionFromEC2Metadata() throws IllegalStateExceptionAttempts to resolve the current region from EC2's instance metadata throughRegions.getCurrentRegion(). If no region is able to be resolved an exception is thrown- Throws:
IllegalStateException
-
-