Example #1
0
        private void LogMessage(Message <Pair <TRecord, TTime> > message)
        {
            var encoder = new AutoSerializedMessageEncoder <TRecord, TTime>(this.Vertex.VertexId, 0, DummyBufferPool <byte> .Pool, this.Vertex.Stage.InternalGraphManager.Controller.Configuration.SendPageSize, AutoSerializationMode.OneTimePerMessage);

            encoder.CompletedMessage += (o, a) =>
            {
                ArraySegment <byte> messageSegment = a.Segment.ToArraySegment();
                this.Vertex.LoggingOutput.Write(messageSegment.Array, messageSegment.Offset, messageSegment.Count);
            };

            for (int i = 0; i < message.length; ++i)
            {
                encoder.Write(message.payload[i]);
            }

            encoder.Flush();
        }
Example #2
0
        protected void LogMessage(Message <S, T> message)
        {
            var encoder = new AutoSerializedMessageEncoder <S, T>(this.Vertex.VertexId, this.channelId, DummyBufferPool <byte> .Pool, this.Vertex.Stage.InternalComputation.Controller.Configuration.SendPageSize, this.Vertex.SerializationFormat);

            encoder.CompletedMessage += (o, a) =>
            {
                ArraySegment <byte> messageSegment = a.Segment.ToArraySegment();
                this.Vertex.LoggingOutput.Write(messageSegment.Array, messageSegment.Offset, messageSegment.Count);
            };

            // XXX : Needs to be fixed up...
            for (int i = 0; i < message.length; ++i)
            {
                encoder.Write(message.payload[i].PairWith(message.time));
            }

            encoder.Flush();
        }