Files
spark/src/DataStreamSuite/PubSub/IPubsubDeserializer.cs
T
2023-09-04 16:25:40 -04:00

33 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace BCG
{
/// <summary>
/// This deserializer resides inside the pubsub. Its deserializes the rows received by the pubsub and hence
/// helps pubsub to mantain its state. Since every row goes through it, its not a bad place to mantain the state
/// as well, hence the getState method. Therefore this Deserializer can not only be used as a deserializer but also
/// as a state holder.
/// </summary>
public interface IPubsubDeserializer
{
/// <summary>
/// Deserializes the data received by the PubSub
/// </summary>
/// <param name="serializedData">Serialized data received by the pubsub from the publisher</param>
/// <param name="rows">Array of IDictionary of id vs rows</param>
/// <param name="op">Operations, each pairing up with the correposnding member of theRows</param>
void deserialize(Stream[] streams, out byte[] theOps, out Array theRows);
/// <summary>
/// Serializes the entire state
/// </summary>
/// <param name="rows"></param>
/// <param name="serializedData"></param>
byte[] getState();
}
}