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

David Reiss commented on THRIFT-110:
------------------------------------

The current system can skip unknown structs.  Even though it doesn't know what 
is supposed to be there, it knows that it is a struct and can read the 
individual field tags and skip the appropriate type.  Take a look at the skip 
protocol method in any of the mappings for details.

The case where I could envision having one field with a large number set would 
be if you have a large enum.  For example, a generic UserAction structure that 
contains hundreds of optional fields for different types of user actions.  A 
log file with a lot of user actions would contain a ton of these structures, 
each with only one field set.  Because there would be lots of different types 
of actions, the bitfield for such a structure would have to be large, but we 
would only use one tag with the current system.  I'm not super-concerned with 
this use case, but I think it is worth considering.  At Facebook, our user 
actions are individual methods in an umbrella service.

> A more compact format 
> ----------------------
>
>                 Key: THRIFT-110
>                 URL: https://issues.apache.org/jira/browse/THRIFT-110
>             Project: Thrift
>          Issue Type: Improvement
>            Reporter: Noble Paul
>
> Thrift is not very compact in writing out data as (say protobuf) . It does 
> not have the concept of variable length integers and various other 
> optimizations possible . In Solr we use a lot of such optimizations to make a 
> very compact payload. Thrift has a lot common with that format.
> It is all done in a single class
> http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/common/util/NamedListCodec.java?revision=685640&view=markup
> The other optimizations include writing type/value  in same byte, very fast 
> writes of Strings, externalizable strings etc 
> We could use a thrift format for non-java clients and I would like to see it 
> as compact as the current java version

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to