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

ASF GitHub Bot commented on HADOOP-18816:
-----------------------------------------

symious commented on code in PR #5863:
URL: https://github.com/apache/hadoop/pull/5863#discussion_r1269247301


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/protocolPB/PBHelper.java:
##########
@@ -134,4 +136,14 @@ public static FileStatusProto convert(FileStatus stat) 
throws IOException {
     return bld.build();
   }
 
+  public static ExceptionReconstructParamsProto getReconstructParams(Throwable 
t) {
+    if (t instanceof ReconstructableException) {

Review Comment:
   Updated, please have a look.



##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RemoteException.java:
##########
@@ -47,12 +50,23 @@ public RemoteException(String className, String msg) {
    * @param erCode may be null
    */
   public RemoteException(String className, String msg, RpcErrorCodeProto 
erCode) {
+    this(className, msg, erCode, null);
+  }
+
+  /**
+   * @param className wrapped exception, may be null

Review Comment:
   Updated.



##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RemoteException.java:
##########
@@ -47,12 +50,23 @@ public RemoteException(String className, String msg) {
    * @param erCode may be null
    */
   public RemoteException(String className, String msg, RpcErrorCodeProto 
erCode) {
+    this(className, msg, erCode, null);
+  }
+
+  /**
+   * @param className wrapped exception, may be null
+   * @param msg may be null
+   * @param erCode may be null
+   */
+  public RemoteException(String className, String msg, RpcErrorCodeProto 
erCode,
+                         ExceptionReconstructParamsProto paramsProto) {
     super(msg);
     this.className = className;
     if (erCode != null)

Review Comment:
   Updated.





> Rebuild Exceptions on Client side to get genuine exceptions
> -----------------------------------------------------------
>
>                 Key: HADOOP-18816
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18816
>             Project: Hadoop Common
>          Issue Type: Task
>            Reporter: Janus Chow
>            Assignee: Janus Chow
>            Priority: Major
>              Labels: pull-request-available
>
> In current's RPC design, if Server sends an exception back, Client can only 
> rebuild the exception according to the original exception's error message, if 
> the exceptions has some fields containing important information, they will be 
> discarded since we can not rebuild them based on message string easily.
> This ticket is to introduce a new interface for Exceptions which supports 
> reconstructing. If Clients want to rebuild the exception, they can just 
> implement the methods and the reconstruction will be done automatically.
> The interface uses String[] as parameter for simplicity.  I thought of using 
> Protobuf to store all the exceptions or fields, but the generacity can not be 
> perfectlly met. So we need Client to support it by accepting "String[]" and 
> transform the String to it's original type.



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