hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lars hofhansl <lhofha...@yahoo.com>
Subject Re: Use of required keyword in protobuf messages
Date Wed, 08 Aug 2012 00:23:15 GMT

I thought we're allowing for a rolling upgrade between major versions.
If server/server is only wire compatible across a minor version that won't be possible.

(this might have been mentioned in the initial discussion we all had about this a while back
and I might have just forgotten)

-- Lars

----- Original Message -----
From: Gregory Chanan <gchanan@cloudera.com>
To: dev@hbase.apache.org
Sent: Tuesday, August 7, 2012 1:33 PM
Subject: Re: Use of required keyword in protobuf messages

I agree with most of the comments here, particularly that at some point we
should go through and review all the "required" fields.

Another thing to keep in mind is that we have only guaranteed the following
are compatible:
- Client/Server across 1 major version
- Server/Server different minor versions

So we don't need to keep required fields for eons, necessarily.  And it may
make sense to be looser about allowing "required" for server/server
communication than for client/server.


On Tue, Aug 7, 2012 at 11:39 AM, Devaraj Das <ddas@hortonworks.com> wrote:

> I too tend to make fields optional unless I am really convinced that the
> field would live for eons. I agree with Google's philosophy in that regard.
> On Aug 6, 2012, at 3:39 PM, Chris Trezzo wrote:
> > Hi All,
> >
> > I was looking through the .proto files and noticed there are a lot of
> > fields that are marked as required. I am by no means a protobuf expert,
> but
> > I was wondering what advantage do we actually get in making fields
> required?
> >
> > I understand that if we don't use the required keyword we would have to
> > implement custom application logic, but the flexibility we gain from
> having
> > all the fields optional seems to outweigh that work. In addition, we will
> > already have to add logic to HBase to handle version compatibility, so it
> > seems natural to implement the required logic as part of that layer. This
> > would allow us to change or delete any message field and maintain wire
> > compatibility.
> >
> > Quote from the protobuf language guide (
> > https://developers.google.com/protocol-buffers/docs/proto):
> >
> > "*Required Is Forever* You should be very careful about marking fields as
> > required. If at some point you wish to stop writing or sending a required
> > field, it will be problematic to change the field to an optional field –
> > old readers will consider messages without this field to be incomplete
> and
> > may reject or drop them unintentionally. You should consider writing
> > application-specific custom validation routines for your buffers instead.
> > Some engineers at Google have come to the conclusion that using
> > requireddoes more harm than good; they prefer to use only
> > optional and repeated. However, this view is not universal."
> >
> > Thoughts?
> >
> > Thanks,
> > Chris Trezzo

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message