Loading classes into registry with batch
commitc30ab5e061241b0c0811e9359581b71ed95b6836
authorBahadir Danisik <bahadird@meta.com>
Sat, 18 Feb 2023 13:22:49 +0000 (18 05:22 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 18 Feb 2023 13:22:49 +0000 (18 05:22 -0800)
treeb8e715e75c1b2c310b32cd79c5f0ddfe985bc5a5
parent44dc6d410cbf5b1dfdee0eddddf2eb662e9bce0b
Loading classes into registry with batch

Summary:
When an IDL contains many object (i.e > 1000), because of java 64K limitation for a method, loading all generated classes into type registry causes problem.

This diff splits the classes into batches (512 classes on each) and load each batch from a static initializer.

Reviewed By: robertroeser

Differential Revision: D43278745

fbshipit-source-id: 82a9e13292522ff47ccb979dbafee08163a75474
43 files changed:
third-party/thrift/src/thrift/compiler/generate/t_mstch_java_generator.cc
third-party/thrift/src/thrift/compiler/generate/templates/java/TypeList.mustache
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-java/test/fixtures/adapter/__fbthrift_TypeList_bf57fac3.java
third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-java/test/fixtures/basicannotations/__fbthrift_TypeList_e331cd8a.java
third-party/thrift/src/thrift/compiler/test/fixtures/basic-enum/gen-java/test/fixtures/swift/enumstrict/__fbthrift_TypeList_1bf74b1c.java
third-party/thrift/src/thrift/compiler/test/fixtures/basic-swift-bean/gen-java/test/fixtures/basic_swift_bean/__fbthrift_TypeList_5c56ecc7.java
third-party/thrift/src/thrift/compiler/test/fixtures/basic/gen-java/test/fixtures/basic/__fbthrift_TypeList_662baa07.java
third-party/thrift/src/thrift/compiler/test/fixtures/big-struct/gen-java/test/fixtures/basic/__fbthrift_TypeList_5c436844.java
third-party/thrift/src/thrift/compiler/test/fixtures/complex-struct/gen-java/test/fixtures/complex_struct/__fbthrift_TypeList_7bf1b804.java
third-party/thrift/src/thrift/compiler/test/fixtures/complex-union/gen-java/test/fixtures/complex_union/__fbthrift_TypeList_8c325ab7.java
third-party/thrift/src/thrift/compiler/test/fixtures/constants/gen-java/test/fixtures/constants/__fbthrift_TypeList_b5dc3af7.java
third-party/thrift/src/thrift/compiler/test/fixtures/empty-struct/gen-java/test/fixtures/empty_struct/__fbthrift_TypeList_a465f4ea.java
third-party/thrift/src/thrift/compiler/test/fixtures/enums/gen-java/test/fixtures/enums/__fbthrift_TypeList_082887bf.java
third-party/thrift/src/thrift/compiler/test/fixtures/exceptions/gen-java/test/fixtures/exceptions/__fbthrift_TypeList_991b3e8f.java
third-party/thrift/src/thrift/compiler/test/fixtures/includes/gen-java/test/fixtures/includes/__fbthrift_TypeList_a3c9273c.java
third-party/thrift/src/thrift/compiler/test/fixtures/includes/gen-java/test/fixtures/includes/__fbthrift_TypeList_c3098fdd.java
third-party/thrift/src/thrift/compiler/test/fixtures/includes/gen-java/test/fixtures/includes/includes/__fbthrift_TypeList_9146df36.java
third-party/thrift/src/thrift/compiler/test/fixtures/includes/gen-java/test/fixtures/includes/transitive/__fbthrift_TypeList_4767708b.java
third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/gen-java/test/fixtures/inheritance/__fbthrift_TypeList_69151fd7.java
third-party/thrift/src/thrift/compiler/test/fixtures/inject_metadata_fields/gen-java/test/fixtures/injectMetadataFields/__fbthrift_TypeList_e1e9fb6e.java
third-party/thrift/src/thrift/compiler/test/fixtures/interactions/gen-java/test/fixtures/interactions/__fbthrift_TypeList_aa8ec19f.java
third-party/thrift/src/thrift/compiler/test/fixtures/java-options/gen-java/data-type/test/fixtures/basic/__fbthrift_TypeList_296c0e35.java
third-party/thrift/src/thrift/compiler/test/fixtures/java-swift-annotation/gen-java/test/fixtures/annotation/__fbthrift_TypeList_a8ddcbb4.java
third-party/thrift/src/thrift/compiler/test/fixtures/java-swift-int-enum/gen-java/test/fixtures/swift/toobigenum/__fbthrift_TypeList_5325c429.java
third-party/thrift/src/thrift/compiler/test/fixtures/java-typedef/gen-java/com/facebook/thrift/test/__fbthrift_TypeList_87a069bd.java
third-party/thrift/src/thrift/compiler/test/fixtures/lazy_constants/gen-java/test/fixtures/lazy_constants/__fbthrift_TypeList_b0ba4cd2.java
third-party/thrift/src/thrift/compiler/test/fixtures/list/gen-java/test/fixtures/list/__fbthrift_TypeList_a836f368.java
third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package/gen-java/dev/test/namespace_from_package/module/__fbthrift_TypeList_f34d8dc8.java
third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/gen-java/dev/test/namespace_from_package_without_module_name/__fbthrift_TypeList_e2067a44.java
third-party/thrift/src/thrift/compiler/test/fixtures/no-legacy-apis/gen-java/test/fixtures/basic/__fbthrift_TypeList_63191fe1.java
third-party/thrift/src/thrift/compiler/test/fixtures/optionals/gen-java/test/fixtures/optionals/__fbthrift_TypeList_d9659dbd.java
third-party/thrift/src/thrift/compiler/test/fixtures/params/gen-java/test/fixtures/params/__fbthrift_TypeList_ad50603c.java
third-party/thrift/src/thrift/compiler/test/fixtures/patch/gen-java/test/fixtures/patch/__fbthrift_TypeList_f5023485.java
third-party/thrift/src/thrift/compiler/test/fixtures/qualified/gen-java/test/fixtures/module0/__fbthrift_TypeList_b5b39133.java
third-party/thrift/src/thrift/compiler/test/fixtures/qualified/gen-java/test/fixtures/module1/__fbthrift_TypeList_a2213d68.java
third-party/thrift/src/thrift/compiler/test/fixtures/qualified/gen-java/test/fixtures/module2/__fbthrift_TypeList_82f8aa63.java
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-java/test/fixtures/refs/__fbthrift_TypeList_b55b3b90.java
third-party/thrift/src/thrift/compiler/test/fixtures/req-opt/gen-java/test/fixtures/req_opt/__fbthrift_TypeList_a45d5a13.java
third-party/thrift/src/thrift/compiler/test/fixtures/serialization_field_order/gen-java/test/fixtures/adapter/__fbthrift_TypeList_c2d2a799.java
third-party/thrift/src/thrift/compiler/test/fixtures/shapes/gen-java/test/fixtures/shapes/__fbthrift_TypeList_d44f3954.java
third-party/thrift/src/thrift/compiler/test/fixtures/sink/gen-java/test/fixtures/sink/__fbthrift_TypeList_0bc15d24.java
third-party/thrift/src/thrift/compiler/test/fixtures/stream/gen-java/test/fixtures/stream/__fbthrift_TypeList_81539e90.java
third-party/thrift/src/thrift/compiler/test/fixtures/terse_write/gen-java/com/facebook/thrift/test/terse_write/__fbthrift_TypeList_5d5a805a.java