THRIFT-1469. java: Java isset space optimization
authorBryan Duxbury <bryanduxbury@apache.org>
Wed, 21 Dec 2011 18:13:29 +0000 (18:13 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Wed, 21 Dec 2011 18:13:29 +0000 (18:13 +0000)
commit1e79cb40f5447b514cad823f14fd32235bf6d07b
tree27d9dc440ec909632608735766e57f02bd4ac38f
parenta2a9ee993e0fb7607ab1bf4173b7037e3c317c28
THRIFT-1469. java: Java isset space optimization

This patch gives the generated code some variable-sized options for the isset bit vector. The compiler will attempt to use byte, short, int and long types before reverting to a BitSet for structs with a LOT of optional fields. This should save a fair amount of memory in a lot of cases.

Patch: Brian Bloniarz

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1221828 13f79535-47bb-0310-9956-ffa450edef68
compiler/cpp/src/generate/t_java_generator.cc
lib/java/build.xml
lib/java/src/org/apache/thrift/EncodingUtils.java
lib/java/test/org/apache/thrift/TestOptionals.java [new file with mode: 0644]
test/ManyOptionals.thrift [new file with mode: 0644]