adoroszlai commented on PR #3820:
URL: https://github.com/apache/ozone/pull/3820#issuecomment-1279403035

   > this just starts the GRPC server on the OM and does not switch the client 
in S3G to start using it.
   
   Maybe I'm missing something, but it seems to me this patch **does switch** 
S3 Gateway to use gRPC for talking to OM by default.
   
   `OmTransportFactory#createFactory` creates the actual factory as an instance 
of the (first) class specified in the service descriptor, which is 
`GrpcOmTransportFactory` for S3 Gateway:
   
   
https://github.com/apache/ozone/blob/46e58a6350e86f7573fe45678e24c5dab96df45a/hadoop-ozone/s3gateway/src/main/resources/META-INF/services/org.apache.hadoop.ozone.om.protocolPB.OmTransportFactory#L15
   
   if the value configured for `ozone.om.transport.class` does not match the 
value of `OMConfigKeys#OZONE_OM_TRANSPORT_CLASS_DEFAULT`, which was and still 
is:
   
   
https://github.com/apache/ozone/blob/46e58a6350e86f7573fe45678e24c5dab96df45a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java#L341-L343
   
   Prior to this patch default value of `ozone.om.transport.class` and 
`OMConfigKeys#OZONE_OM_TRANSPORT_CLASS_DEFAULT` did match, so S3 Gateway used 
the default transport despite its service descriptor.  Since the value in 
`ozone-default.xml` is being changed, this condition will now be true by 
default:
   
   
https://github.com/apache/ozone/blob/46e58a6350e86f7573fe45678e24c5dab96df45a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OmTransportFactory.java#L48-L54
   
   So `GrpcOmTransportFactory` will be created by default for S3 Gateway, i.e. 
it will switch to the gRPC client.
   
   From `ozone` compose environment with default configs:
   
   ```
   s3g_1       | 2022-10-14 19:32:35,747 [qtp661119548-86] INFO 
protocolPB.OmTransportFactory: ZZZ created custom OmTransportFactory: 
org.apache.hadoop.ozone.om.protocolPB.GrpcOmTransportFactory@77d1c0db
   s3g_1       | 2022-10-14 19:32:35,920 [qtp661119548-86] INFO 
protocolPB.GrpcOmTransport: GrpcOmTransport: started
   ```
   
   The first log message is one I added in `OmTransportFactory`.
   
   Also, enabling it only in OM, but not in S3 Gateway, would not have the 
following benefit:
   
   > Enabling it by default will allow to have more people to try it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to