Ejemplo n.º 1
0
 internal FrameStreamer(FasterFrameTable table,
                        RawFramesStore.ClientSession framesStoreClient,
                        int autoFlushRecordCount)
 {
     _table                = table;
     _framesStoreClient    = framesStoreClient;
     _autoFlushRecordCount = autoFlushRecordCount;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Opens an existing conversation table persisted in the specified folder.
        /// </summary>
        /// <param name="folder">The folder containing conversation table files.</param>
        /// <returns>New instance of the conversation table.</returns>
        public static FasterFrameTable Open(string folder)
        {
            if (!Directory.Exists(folder))
            {
                throw new DirectoryNotFoundException($"Specified folder '{folder}' not found.");
            }
            var config = new Configuration(Path.Combine(folder, "settings.json")).Load();
            var table  = new FasterFrameTable(folder, config);

            table._framesStore.InitAndRecover();
            return(table);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new conversation table.
        /// </summary>
        /// <param name="folder">The destination folder to persist conversation table.</param>
        /// <param name="framesCapacity">The expected frame capacity of the table. The conversation table offerst bets performance and space
        /// if the actual frame number is around this value.</param>
        /// <param name="flowFrameRatio">The expected ratio between flows and frames. It can be computed as "1 / average frames per flow".</param>
        /// <returns>New instance of the conversation table.</returns>
        public static FasterFrameTable Create(string folder, long framesCapacity)
        {
            // ensure that root folder does exist:
            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }
            var config = new Configuration(Path.Combine(folder, "settings.json"))
            {
                FramesCapacity = framesCapacity,
            };

            config.Save();  // need to save as we create a new configuration
            var table = new FasterFrameTable(folder, config);

            table._framesStore.InitAndRecover();
            return(table);
        }