Thrift interface: struct field names

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Thrift interface: struct field names

Felix Martini
Hi all,

Structs in the Thrift interface have field names with underscores. The
Thrift code generator does not convert them to camel case names which
is common for .NET, e.g. a Column_family property is generated instead
of ColumnFamily for the ColumnParent class. If i understand it
correctly the Thrift wire format only uses the field identifier and
type and not the name. So if i change the field names of the Cassandra
interface file to camel case and generate the interface code, the code
should still work with Cassandra servers. Is that correct?

Best regards,
Felix
Reply | Threaded
Open this post in threaded view
|

Re: Thrift interface: struct field names

Michael Greene
That's substantially true, yes.  Any other utilities built on top of the original generated C# code will likely fail, or any introspection utilities expecting those field names, but at the protocol and transport layers (and on the Java server side) you will see no difference.

Michael

On Wed, Jul 29, 2009 at 2:53 PM, Felix Martini <[hidden email]> wrote:
Hi all,

Structs in the Thrift interface have field names with underscores. The
Thrift code generator does not convert them to camel case names which
is common for .NET, e.g. a Column_family property is generated instead
of ColumnFamily for the ColumnParent class. If i understand it
correctly the Thrift wire format only uses the field identifier and
type and not the name. So if i change the field names of the Cassandra
interface file to camel case and generate the interface code, the code
should still work with Cassandra servers. Is that correct?

Best regards,
Felix