hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Purtell (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-8915) protobuf message style
Date Wed, 10 Jul 2013 16:07:48 GMT

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

Andrew Purtell commented on HBASE-8915:
---------------------------------------

+1 

Checked the patch, the Java side getter and setter method names do not change. 

Field constant names do change but we don't use those.

There is one difference in RPC, we see it in TokenProvider:

{noformat}
diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java
hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java
index 30bb8af..f48bc5a 100644
--- hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java
+++ hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java
@@ -133,7 +133,7 @@ public class TokenProvider implements AuthenticationProtos.AuthenticationService
   }
 
   @Override
-  public void whoami(RpcController controller, AuthenticationProtos.WhoAmIRequest request,
+  public void whoAmI(RpcController controller, AuthenticationProtos.WhoAmIRequest request,
                      RpcCallback<AuthenticationProtos.WhoAmIResponse> done) {
     User requestUser = RequestContext.getRequestUser();
     AuthenticationProtos.WhoAmIResponse.Builder response =
{noformat}

but this seems fine.
                
> protobuf message style
> ----------------------
>
>                 Key: HBASE-8915
>                 URL: https://issues.apache.org/jira/browse/HBASE-8915
>             Project: HBase
>          Issue Type: Improvement
>          Components: Protobufs
>            Reporter: Dan Burkert
>            Priority: Minor
>         Attachments: 8915.v1.patch
>
>
> Google's protobuf style guide (https://developers.google.com/protocol-buffers/docs/style)
lays out the convention that message field names should be underscore_separated and services
should be MixedCase. The .proto's in trunk do not follow this style; instead they follow Java
naming conventions. The protobuf compiler will automatically change the style of names to
match the language it is compiling for, but it is unable to do so if the protobuf style is
not used. As a result, using the HBase proto files from languages with different naming conventions
than Java is a little bit more painful.
> Since a core feature of moving to protobufs is opening the door to wire compatible implementations
in other languages, I think this may want to be addressed. This patch changes the naming convention
in the protos. The resulting .java files that the protobuf compiler puts out are functionally
the same (with the same correct Java naming style).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message