[
https://issues.apache.org/jira/browse/THRIFT-1270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13086686#comment-13086686
]
Hudson commented on THRIFT-1270:
--------------------------------
Integrated in Thrift #222 (See [https://builds.apache.org/job/Thrift/222/])
THRIFT-1270. compiler: add --allow-neg-keys argument to allow
This switch allows the user to specify explicit negative field IDs in Thrift
IDL in order to avoid breaking wire protocol.
Patch: Dave Watson
bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1158967
Files :
* /thrift/trunk/compiler/cpp/src/main.cc
* /thrift/trunk/compiler/cpp/src/thrifty.yy
* /thrift/trunk/compiler/cpp/src/globals.h
* /thrift/trunk/compiler/cpp/src/parse/t_field.h
> thrift: add --allow-neg-keys argument to allow
> ------------------------------------------------
>
> Key: THRIFT-1270
> URL: https://issues.apache.org/jira/browse/THRIFT-1270
> Project: Thrift
> Issue Type: Improvement
> Components: C++ - Library
> Reporter: Dave Watson
> Assignee: Dave Watson
> Priority: Minor
> Fix For: 0.8
>
> Attachments:
> 0002-thrift-add-allow-neg-keys-argument-to-allow-negative.patch.diff
>
>
> From 0df0b8cec89a9d7652fbbabd06e5b4d153537431 Mon Sep 17 00:00:00 2001
> From: Dave Watson <[email protected]>
> Date: Tue, 2 Aug 2011 08:40:44 -0700
> Subject: [PATCH 02/33] thrift: add --allow-neg-keys argument to allow
> negative field keys
> Summary:
> Several of our .thrift files already deployed in production do not have
> explicitly specified key values for all fields. Thrift automatically
> chooses negative values for these keys (and also emits a warning while
> doing so). Previously, this couldn't be fixed without breaking protocol
> compatibility, since thrift refuses to accept explicitly specified
> negative key values.
> This new flag causes thrift to accept negative key values, so that these
> older .thrift files can be updated with explicitly specified values. It
> emits a warning if a negative value is specified that is different from
> what thrift would have otherwise chosen.
> Test Plan:
> Tested modifying common/fbunit/logger/if/UnitTestLogger.thrift
> and biggrep/BigGrep.thrift to pass in negative field values.
> I'll check in the changes to these .thrift files separately, since it
> also requires changes to fbconfig to support passing in the
> --allow-neg-keys argument. For fbunit, I'll probably change it to just
> use positive key values, since we don't really care about backwards
> compatibility in that case.
> ---
> compiler/cpp/src/globals.h | 15 +++++++++++++
> compiler/cpp/src/main.cc | 10 ++++++++
> compiler/cpp/src/parse/t_field.h | 9 ++++++++
> compiler/cpp/src/thrifty.yy | 43 +++++++++++++++++++++++++++++++------
> 4 files changed, 70 insertions(+), 7 deletions(-)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira