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

stack commented on HBASE-7533:
------------------------------

bq. Maybe, have such exceptions implement an interface like PBException that 
has methods that would allow them to be ser/de.

First, let me say, using exceptions for messaging is perverse as 
RegionMovedException is doing.

Second, how many instances of payload carrying exceptions do we have?  One, two?

How would this work?  Per Exception, we would define a pb Message (because we 
want to use pb serializing).  You can't have a pb Message be an exception 
because it can't inherit, not unless we mess w/ protoc, nor can we subclass the 
pb since Throwable is a class, so, PBException would have serializeAsPB and 
deserializeAsPB methods in its Interface (sounds like Writable!).

On serverside, when we get one of these messages, we would treat it different 
doing the above serializeAsPB.  We'd then have an 'exception' pb Message.  I 
would mark the header saying we have an exception and then I'd also write the 
classname into the response header.

On client, would notice an exception then would see if a classname.  If 
present, would create an instance or just invoke a static deserialize method 
that would know the pb to use and would undo the pb (can't have static methods 
in Interfaces so this route would be a little messy), then we would return an 
instance of aforementioned exception, wrap it in RemoteException and throw it?

Sounds like a bit of work.  Complicates things some too.  If our rpc is simple, 
prospect of writing a non-java client would be less daunting.

What you reckon?

                
> Write an RPC Specification for 0.96
> -----------------------------------
>
>                 Key: HBASE-7533
>                 URL: https://issues.apache.org/jira/browse/HBASE-7533
>             Project: HBase
>          Issue Type: Bug
>            Reporter: stack
>            Assignee: stack
>             Fix For: 0.96.0
>
>         Attachments: 7533_proto_sketch.txt
>
>
> RPC format is changing for 0.96 to accomodate our protobufing all around.  
> Here is a first cut.  Please shred: 
> https://docs.google.com/document/d/1-1RJMLXzYldmHgKP7M7ynK6euRpucD03fZ603DlZfGI/edit

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

Reply via email to