Beispiel #1
0
 internal FrameStreamer(FasterFrameTable table,
                        RawFramesStore.ClientSession framesStoreClient,
                        int autoFlushRecordCount)
 {
     _table                = table;
     _framesStoreClient    = framesStoreClient;
     _autoFlushRecordCount = autoFlushRecordCount;
 }
Beispiel #2
0
        /// <summary>
        /// Insert a new frame to the frame store.
        /// </summary>
        /// <param name="client">The client used to insert the frame to the store.</param>
        /// <param name="frame"></param>
        /// <param name="bytes"></param>
        /// <param name="address"></param>
        /// <param name="frameFlowKey"></param>
        /// <returns></returns>
        private unsafe void InsertFrame(RawFramesStore.ClientSession client, ref FrameKey frameKey, ref FlowKey frameFlowKey, ref FrameMetadata frameMetadata, Span <byte> frameBytes)
        {
            var bufferSize = Unsafe.SizeOf <FrameMetadata>() + frameBytes.Length;


            if (bufferSize < 128)
            {
                var bufferPtr = stackalloc byte[bufferSize];

                var frameValue = new Span <byte>(bufferPtr, bufferSize);
                Unsafe.Copy(bufferPtr, ref frameMetadata);
                frameBytes.CopyTo(frameValue[Unsafe.SizeOf <FrameMetadata>()..]);