-
Notifications
You must be signed in to change notification settings - Fork 4
S3 Endpoint Support
Yukihiro Okada edited this page Mar 12, 2018
·
5 revisions
こんなけ。
String S3_ENDPOINT = "presto.s3.endpoint";
config.set(S3_ENDPOINT, "test.example.endpoint.com");
boolean regionOrEndpointSet = false;
// use local region when running inside of EC2
if (pinS3ClientToCurrentRegion) {
Region region = Regions.getCurrentRegion();
if (region != null) {
clientBuilder = clientBuilder.withRegion(region.getName());
regionOrEndpointSet = true;
}
}
String endpoint = hadoopConfig.get(S3_ENDPOINT);
if (endpoint != null) {
clientBuilder = clientBuilder.withEndpointConfiguration(new EndpointConfiguration(endpoint, null));
regionOrEndpointSet = true;
}
if (isPathStyleAccess) {
clientBuilder = clientBuilder.enablePathStyleAccess();
}
if (!regionOrEndpointSet) {
clientBuilder = clientBuilder.withRegion(US_EAST_1);
clientBuilder.setForceGlobalBucketAccessEnabled(true);
}
return clientBuilder.build();