Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-3067

Implement a streaming response decoder for events stream

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.24.0
    • None
    • None

    Description

      We need a streaming response decoder to de-serialize chunks sent from the master on the events stream.

      From the HTTP API design doc:
      Master encodes each Event in RecordIO format, i.e. a string representation of length of the event in bytes followed by JSON or binary Protobuf (possibly compressed) encoded event.

      As of now for getting the basic features right , this is being done in the test-cases:

        auto reader = response.get().reader;
        ASSERT_SOME(reader);
      
        Future<std::string> eventFuture = reader.get().read();
        AWAIT_READY(eventFuture);
      
        Event event;
        event.ParseFromString(eventFuture.get());
      

      Two things need to happen:

      • We need master to emit events in RecordIO format i.e. event size followed by the serialized event instead of just the serialized events as is the case now.
      • The decoder class should then abstract away the logic of reading the response and de-serializing events from the stream.

      Ideally, the decoder should work with both "json" and "protobuf" responses.

      Attachments

        Issue Links

          Activity

            People

              bmahler Benjamin Mahler
              anandmazumdar Anand Mazumdar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: