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

Jens Geyer commented on THRIFT-2943:
------------------------------------

You are welcome to ask questions about using Thrift, but *please use the 
[Thrift user mailing 
list|http://mail-archives.apache.org/mod_mbox/thrift-user/]* in the future. 
JIRA is not really intended to be used for that purpose. 

{quote}
Can struct/exception definitions ever be removed?
{quote}

Sure, if they are no longer referenced anymore. The recommendation is however, 
to comment them out from the IDL in order to prevent re-using the old field IDs 
in the future which would product incompatibilities otherwise.

{quote}
Can structs/exceptions be renamed?
{quote}

Sure, they can. Regarding the wire format the identification is made by means 
of the field IDs, the knowledge about the layout of the data is built in into 
the generated code. Note that you may *not* rename services and service 
functions, because they are identified by name. If it is a public API you may 
annoy your users, but that's not a technical issue.

{quote}
What's the process for changing what arguments a function can take?
What's the process for changing the list of exceptions a function can throw?
{quote}

Same as with structs. Add or remove as you like, just make sure the server 
handler is aware of all cases. Same is true with exceptions. 

{quote}
What's the process for changing the return type of a function?
Can/should/may i change the {{oneway}} attribute of a function?
{quote}

Changing the return type and/or the {{oneway}} attribute is *not* recommended, 
as this will break compatibility of your API. Regharding return types, the 
recommendation is to use a {{struct}} if in doubt. Doing so you enables you to 
change the layout of the returned data easily and freely in the future.

{quote}
Is there existing documentation to help me answer these questions? 
{quote}

[Diwaker Gupta's Missing Guide is a good 
start|http://diwakergupta.github.io/thrift-missing-guide/thrift.pdf]

{quote}
I'd also love to see some examples of real interfaces and how they've changed 
over time.
{quote}

Look at the [Cassandra IDL 
file|https://github.com/apache/cassandra/commits/trunk/interface/cassandra.thrift],
 this file has some history. Also the HBase IDL files may serve as another one. 
For more examples, try [searching by file 
type|http://www.google.de/search?q=service+filetype%3Athrift].



> Guidance about upgrading Interface Definition Files
> ---------------------------------------------------
>
>                 Key: THRIFT-2943
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2943
>             Project: Thrift
>          Issue Type: Documentation
>            Reporter: Jordan Librande
>            Priority: Minor
>
> I have an existing thrift service with consumers. I want to upgrade the 
> interface file to a newer version. I haven't been able to find any resources 
> talking about this process in depth.
> Some of the questions I have:
> Can struct/exception definitions ever be removed?
> Can structs/exceptions be renamed?
> What's the process for changing what arguments a function can take?
> What's the process for changing the list of exceptions a function can throw?
> What's the process for changing the return type of a function?
> Is there existing documentation to help me answer these questions? I'd also 
> love to see some examples of real interfaces and how they've changed over 
> time.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to