Support unions in thrift random mixer
Support unions in thrift random mixer

Summary:
Thrift unions are not handled in the code that randomizes production traffic. This can cause an unhandled exception (see https://fb.workplace.com/groups/cogwheelusers/permalink/2874181719482982/).

Basically, a Thrift union object has two attributes, `field` (which is 0,1,2... depending on which sub-object is present in the union), and `value` (the sub-object itself). The current code that handles structs could select a `field` value from object 1 and a `value` value from object2, and this mismatch would cause the code to later fail since the objects have unexpected types.

The solution is to handle unions explicitly, and keep `field` and `value` together when doing the randomization.

Reviewed By: thechrisu

Differential Revision: D25783014

fbshipit-source-id: ae76f36f882425c5d28a92923608cdbf79b3576f

facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift