[ 
https://issues.apache.org/jira/browse/HDDS-525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16631858#comment-16631858
 ] 

Elek, Marton commented on HDDS-525:
-----------------------------------

Thanks [~bharatviswa]. Overall it looks good to me, tested and worked well.

1. I would prefer to support both use cases: virtual style and path style urls. 
Currently it can't work without setting the s3g dns.

{code}
org.apache.hadoop.fs.InvalidRequestException: Invalid S3 Gateway request 
org.glassfish.jersey.server.internal.routing.UriRoutingContext@6d4d66d2
{code}

I would skip the processing in case of domains is empty array 
(ozone.s3g.domain.name is unset).

2. BTW this error message could be improved I think (just convert uri to string 
and add an additional hint that it's a problem with dns/domain name parsing)

3. I would use the original path style approach in the ozones3g docker-compose 
file. I would like to use it for acceptance tests and I don't know (yet) how 
can I set the dns name from robot test. We can provide an additional docker 
subdirectory to test the virtual host based approach (and long-term we can 
execute the same s3 robot tests in both the environments)

4. Very minor nit: You can use

{code}
 SecurityContext securityContext = Mockito.mock(SecurityContext.class);
    PropertiesDelegate propertiesDelegate =
        Mockito.mock(PropertiesDelegate.class)
{code}

in TestVirtualHostStyleFilter. It's exactly the same what you did (by default 
mockito creates an object which returns with null/false from the methods), but 
more shorter.

5. Not sure why do we need this line in docker-compose:

{code}
OZONE-SITE.XML_ozone.s3g.https-address=s3g:9878
{code}

But as I wrote I prefer to clone ozones3g and create a virtual-host style 
docker dir

> Support virtual-hosted style URLs
> ---------------------------------
>
>                 Key: HDDS-525
>                 URL: https://issues.apache.org/jira/browse/HDDS-525
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Elek, Marton
>            Assignee: Bharat Viswanadham
>            Priority: Major
>         Attachments: HDDS-525.00.patch, HDDS-525.02.patch, HDDS-525.03.patch
>
>
> AWS supports to kind of pattern for the base url of the s3 rest api: 
> virtual-hosted style and path-style.
> Path style: http://s3.us-east-2.amazonaws.com/bucket
> Virtual-hosted style: http://bucket.s3.us-east-2.amazonaws.com
> By default we support the path style method with the volume name in the url:
> http://s3.us-east-2.amazonaws.com/volume/bucket
> Here the endpoint url is http://s3.us-east-2.amazonaws.com/volume/ and the 
> bucket is appended.
> Some of the 3rd party s3 tools (goofys is an example) Supports only the 
> virtual style method. With goofys we can set a custom endpoint 
> (http://localhost:9878) but all the other postfixes after the port are 
> removed.
> It can be solved with using virtual-style url which also could include the 
> volume name:
> http://bucket.volume..........com
> The easiest way is to support both of them is implementing a 
> ContainerRequestFilter which can parse the hostname (based on a configuration 
> value) and extend the existing url with adding the missing volume/bucket 
> part. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to