Package io.trino.hdfs.s3
Class AwsCurrentRegionHolder
java.lang.Object
io.trino.hdfs.s3.AwsCurrentRegionHolder
Caches the result of calling
Regions.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
Modifier and TypeMethodDescriptionstatic com.amazonaws.regions.RegionAttempts to resolve the current region from EC2's instance metadata throughRegions.getCurrentRegion().
-
Method Details
-
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
-