[ 
https://issues.apache.org/jira/browse/HDFS-15790?focusedWorklogId=600923&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-600923
 ]

ASF GitHub Bot logged work on HDFS-15790:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/May/21 12:05
            Start Date: 23/May/21 12:05
    Worklog Time Spent: 10m 
      Work Description: jojochuang commented on a change in pull request #2767:
URL: https://github.com/apache/hadoop/pull/2767#discussion_r637485155



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine2.java
##########
@@ -495,6 +524,7 @@ private static ProtoClassProtoImpl 
getProtocolImpl(RPC.Server server,
        * it is.</li>
        * </ol>
        */
+      @SuppressWarnings("deprecation")

Review comment:
       It would help a lot for the applications using the new 
ProtobufRpcEngine2 what API replaces this deprecated API.
   Maybe it can be written in the javadoc; or in the release note.

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/ProtobufRpcEngine.java
##########
@@ -443,144 +430,52 @@ public Server(Class<?> protocolClass, Object 
protocolImpl,
         SecretManager<? extends TokenIdentifier> secretManager, 
         String portRangeConfig, AlignmentContext alignmentContext)
         throws IOException {
-      super(bindAddress, port, null, numHandlers,
-          numReaders, queueSizePerHandler, conf,
-          serverNameFromClass(protocolImpl.getClass()), secretManager,
-          portRangeConfig);
-      setAlignmentContext(alignmentContext);
-      this.verbose = verbose;  
-      registerProtocolAndImpl(RPC.RpcKind.RPC_PROTOCOL_BUFFER, protocolClass,
-          protocolImpl);
+      super(protocolClass, protocolImpl, conf, bindAddress, port, numHandlers,
+          numReaders, queueSizePerHandler, verbose, secretManager,
+          portRangeConfig, alignmentContext);
     }
 
-    @Override
-    protected RpcInvoker getServerRpcInvoker(RpcKind rpcKind) {
-      if (rpcKind == RpcKind.RPC_PROTOCOL_BUFFER) {
-        return RPC_INVOKER;
-      }
-      return super.getServerRpcInvoker(rpcKind);
-    }
-
-    /**
-     * Protobuf invoker for {@link RpcInvoker}
-     */
-    static class ProtoBufRpcInvoker implements RpcInvoker {
-      private static ProtoClassProtoImpl getProtocolImpl(RPC.Server server,
-          String protoName, long clientVersion) throws RpcServerException {
-        ProtoNameVer pv = new ProtoNameVer(protoName, clientVersion);
-        ProtoClassProtoImpl impl = 
-            server.getProtocolImplMap(RPC.RpcKind.RPC_PROTOCOL_BUFFER).get(pv);
-        if (impl == null) { // no match for Protocol AND Version
-          VerProtocolImpl highest = 
-              
server.getHighestSupportedProtocol(RPC.RpcKind.RPC_PROTOCOL_BUFFER, 
-                  protoName);
-          if (highest == null) {
-            throw new RpcNoSuchProtocolException(
-                "Unknown protocol: " + protoName);
-          }
-          // protocol supported but not the version that client wants
-          throw new RPC.VersionMismatch(protoName, clientVersion,
-              highest.version);
-        }
-        return impl;
+    static RpcWritable processCall(RPC.Server server,

Review comment:
       can you add a comment here that this is practically the same as 
ProtobufRpccEngine2.call() except the Message class, and that if this method is 
modified, the other method should be updated as well? (Or add the comment in 
the ProtobufRpccEngine2.call())

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RPC.java
##########
@@ -937,11 +937,18 @@ public int hashCode() {
     */
    static class ProtoClassProtoImpl {
      final Class<?> protocolClass;
-     final Object protocolImpl; 
+      final Object protocolImpl;
+      private final boolean newPBImpl;
+
      ProtoClassProtoImpl(Class<?> protocolClass, Object protocolImpl) {
        this.protocolClass = protocolClass;
        this.protocolImpl = protocolImpl;
+        this.newPBImpl = protocolImpl instanceof BlockingService;
      }
+
+      public boolean isNewPBImpl() {

Review comment:
       Might be easier to understand to call it "isShadedPBImpl()" instead




-- 
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.

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 600923)
    Time Spent: 3h 20m  (was: 3h 10m)

> Make ProtobufRpcEngineProtos and ProtobufRpcEngineProtos2 Co-Exist
> ------------------------------------------------------------------
>
>                 Key: HDFS-15790
>                 URL: https://issues.apache.org/jira/browse/HDFS-15790
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Critical
>              Labels: pull-request-available, release-blocker
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> Changing from Protobuf 2 to Protobuf 3 broke some stuff in Apache Hive 
> project.  This was not an awesome thing to do between minor versions in 
> regards to backwards compatibility for downstream projects.
> Additionally, these two frameworks are not drop-in replacements, they have 
> some differences.  Also, Protobuf 2 is not deprecated or anything so let us 
> have both protocols available at the same time.  In Hadoop 4.x Protobuf 2 
> support can be dropped.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to