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

Flavio Junqueira commented on BOOKKEEPER-582:
---------------------------------------------

bq. Use of an enum for flags

Ideally, we use something like an enumset here, but I'm not sure if it works 
well with protobufs. Another option is a list of enum instances. I don't like 
very much the use of combinations of flags, although I understand Sijie is 
proposing it for efficient processing.

bq. Sending error messages twice

I'm assuming that a packet-level error is something like a message not parsing 
and an app level error is something like an entry doesn't exist in a ledger. If 
this interpretation is right, then I don't see us sending both types of error 
codes in the same message. If the message goes through ok, but the operation 
doesn't process correctly (e.g., entry doesn't exist), then we only need the 
application-level error. In the case of a packet-level error, then we return 
only that error and the client produces a return code if needed. Also, the 
error codes seem to be logically separated, so they should be perhaps in 
different enums.

bq. Use of enum for errors

Introducing logic for backward compatibility is tricky. It is not hard to 
forget something or simply not get it 100% right. Using integers, however, is 
less clear, less structure, and opens up to errors due to unused values. In 
general, I prefer the use of enums, but I'm not sure what the protobufs code 
does if it finds an unknown value. Is there a way of telling it to assign a 
default value?

bq. Too much required

Sijie's assessment about ledgerid, entryid seems right to me. I wonder if there 
is something else here that Ivan is concerned about.
   

> Make bookie and client use protobuf for requests (non-wire part)
> ----------------------------------------------------------------
>
>                 Key: BOOKKEEPER-582
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-582
>             Project: Bookkeeper
>          Issue Type: Sub-task
>          Components: bookkeeper-client, bookkeeper-server
>            Reporter: Ivan Kelly
>            Assignee: Aniruddha
>             Fix For: 4.3.0
>
>         Attachments: 
> 0002-BOOKKEEPER-582-Make-bookie-and-client-use-protobuf-f.patch, 
> 0002-BOOKKEEPER-582-Make-bookie-and-client-use-protobuf-f.patch, 
> 0002-BOOKKEEPER-582-Make-bookie-and-client-use-protobuf-f.patch, 
> 0003-BOOKKEEPER-582-Make-bookie-and-client-use-protobuf-f.patch, 
> BOOKKEEPER-582.diff, BOOKKEEPER-582.v2.diff, BOOKKEEPER-582.v3.diff
>
>
> Make the client and the bookie use protobufs internally. This is the first 
> step to using protobufs on the wire, but for the moment, BookieRequestHandler 
> decodes the old wire protocol into the protobuf messages. Once this is in, 
> enabling on the wire will be very simple, and the old manual serialization 
> can be made "legacy" (still supported, but deprecated).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to