Skip to content

S3 Endpoint Support

Yukihiro Okada edited this page Mar 12, 2018 · 5 revisions

こんなけ。

https://github.com/prestodb/presto/blob/dc4dbd685f4c9226aab04ceec2dbf9c5cf18eee4/presto-hive/src/main/java/com/facebook/presto/hive/s3/S3ConfigurationUpdater.java#L43

    String S3_ENDPOINT = "presto.s3.endpoint";

https://github.com/prestodb/presto/blob/5e2e9c45aae7e5bb6bb507b4121c5b0fc51f52ca/presto-hive/src/test/java/com/facebook/presto/hive/s3/TestPrestoS3FileSystem.java#L100

        config.set(S3_ENDPOINT, "test.example.endpoint.com");

https://github.com/prestodb/presto/blob/eb176875ac5da1f1d57de54042be345105ac5d40/presto-hive/src/main/java/com/facebook/presto/hive/s3/PrestoS3FileSystem.java#L659-L672

        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();


https://play.minio.io:9000/minio/orc-demo/

Clone this wiki locally