thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Chung <geo...@glympse.com>
Subject Re: updating to longer ints
Date Thu, 14 Mar 2013 16:56:40 GMT
I'm pretty sure the answer would be "no".

The Thrift "way" would be to create a new field for the i32 field, say 101.

The backwards compatible service would be able to read from field 1 or
field 101. Newer services would only produce an integer value at field 101.
Older services would provide the integer value at field 1.

In other words, the logic that you propose, would have to be handled at the
application layer.

On Thu, Mar 14, 2013 at 3:46 AM, John R. Frank <jrf@mit.edu> wrote:

> Thrift Experts,
>
> Is there any way to make a thrift message with a longer integer read an
> older message definition with a smaller integer?
>
> struct Thing_original {
>   1:  i16 idx,
> }
>
> struct Thing_newer {
>   1:  i32 idx,
> }
>
>
> I'd like to be able to have Thing_newer read *both* kinds of idx.  Simple
> tests show that this does not work.
>
> Is there a way to tell Thing_newer to fallback to looking for (idx, i16)
> if it cannot find (idx, i32)?
>
>
> JOhn
>

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