Ejemplo n.º 1
0
        /// <summary>
        /// 执行索引程序入口
        /// </summary>
        /// <param name="args"></param>
        public override void Run(object[] args)
        {
            Init(args);
            segment = HMMSegment.GetInstance();
            DataSaver dataSaver = new DataSaver();

            string rawDatafolder = GetRootFolder() + "\\RawData";
            string folder        = GetRootFolder() + "\\ISE";

            try
            {
                string[] files = Directory.GetFiles(rawDatafolder);
                //if (files.Length < 2)
                //{
                //    // 如果个数小于等于1,则休眠10min
                //    Thread.Sleep(1000 * 60 * 10);
                //}
                for (int i = 0; i < files.Length; i++)
                {
                    if (!fileVisited.Contains(files[i]))
                    {
                        fileVisited.Add(files[i]);
                        try
                        {
                            Console.WriteLine(i + "/" + files.Length);
                            dataSaver.AnalysisData(folder, files[i]);
                        }
                        catch (Exception exception)
                        {
                            Console.WriteLine(exception);
                        }
                    }
                }
            }

            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }