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

ASF GitHub Bot commented on MAPREDUCE-6706:
-------------------------------------------

steveloughran commented on code in PR #8422:
URL: https://github.com/apache/hadoop/pull/8422#discussion_r3073095477


##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/TaskStatus.java:
##########
@@ -523,5 +523,32 @@ static TaskStatus createTaskStatus(boolean isMap) {
     return (isMap) ? new MapTaskStatus() : new ReduceTaskStatus();
   }
 
+  /**
+   * Write a TaskStatus to a DataOutput, prefixed by an isMap discriminator 
byte.
+   * Used by the Protobuf-based RPC layer to serialize TaskStatus values.
+   * @param out output stream
+   * @param status status to write (must not be null)
+   * @throws IOException on I/O error
+   */
+  public static void writeTaskStatusForPB(DataOutput out, TaskStatus status)
+      throws IOException {
+    out.writeBoolean(status.getIsMap());

Review Comment:
   if MR ever gets updated (who? why?) they can update the private protocol 
then. 
   
   alternatively: include the classname as the field and do a switch on it?



##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapred/protocolPB/package-info.java:
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * This package contains the protobuf implementation of the MR 
TaskUmbilicalProtocol which was originally
+ * a {@code WritableRPC} protocol.
+ * To marshall some of the complex MR datatypes, such as {@code Task}, some 
objects are serialized to bytes
+ * and send in the RPC messages as binary objects, rather than fully defined 
in protobuf messages.
+ */
+
[email protected]
+package org.apache.hadoop.mapred.protocolPB;
+
+import org.apache.hadoop.classification.InterfaceAudience;

Review Comment:
   nit: newline





> Update TaskUmbilicalProtocol to use ProtobufRPCEngine
> -----------------------------------------------------
>
>                 Key: MAPREDUCE-6706
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6706
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>            Reporter: Arun Suresh
>            Assignee: Steve Loughran
>            Priority: Major
>              Labels: pull-request-available
>
> Currently, {{TaskUmbilicalProtocol}} still uses {{WritableRPCEngine}}, which 
> should be moved to {{ProtocolRPCEngine}} so that the former can be deprecated 
> as tracked by HADOOP-12579



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to