Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-519

Support collections of types without having to explicitly define it

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 0.10.0
    • Component/s: None
    • Labels:
      None

      Description

      I frequently find myself needing to be able to serialize/deserialize collections of objects across languages. Every time I need one of these collections, I have to explicitly define it in a thrift file. Some examples are:

      struct FriendSet {
      1: set<binary> friend_ids;
      }

      struct StringList {
      1: list<string> strings;
      }

      struct FooList {
      1: list<Foo> foos; // foo is a thrift struct
      }

      It would be convenient if Thrift supported collections of objects directly. Perhaps serialize/deserialize can support taking a list or set, such as:

      TDeserializer des = new TDeserializer();
      List<Foo> myList = new ArrayList<Foo>();
      des.deserialize(myList, record);

        Attachments

          Activity

            People

            • Assignee:
              jking3 James E. King III
              Reporter:
              marz Nathan Marz
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: