public void Write(TProtocol oprot)
    {
        TStruct struc = new TStruct("ExecutorSpecificStats");

        oprot.WriteStructBegin(struc);
        TField field = new TField();

        if (Bolt != null && __isset.bolt)
        {
            field.Name = "bolt";
            field.Type = TType.Struct;
            field.ID   = 1;
            oprot.WriteFieldBegin(field);
            Bolt.Write(oprot);
            oprot.WriteFieldEnd();
        }
        if (Spout != null && __isset.spout)
        {
            field.Name = "spout";
            field.Type = TType.Struct;
            field.ID   = 2;
            oprot.WriteFieldBegin(field);
            Spout.Write(oprot);
            oprot.WriteFieldEnd();
        }
        oprot.WriteFieldStop();
        oprot.WriteStructEnd();
    }