Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            PrintTitle();
            GetAndCheckArgs(args);

            //if we get here, all required params are met
            try
            {
                //no split
                if (!_split)
                {
                    Console.WriteLine("Starting RDFing...");

                    if (_isSingleFile)
                    {
                        var rdfER = new RDFer(_dataPath, _configPath, _outputPath, _includeStackTrackInOutput, _format);
                        rdfER.Start();
                        rdfER.Dispose();
                        rdfER = null;
                    }
                    else if (_isDirectoryOfFiles)
                    {
                        List <string> inputFiles = GetAllInputFiles(_dataPath, new List <string>());

                        foreach (string inputFile in inputFiles)
                        {
                            Console.WriteLine("Processing File: " + inputFile);
                            var rdfER = new RDFer(inputFile, _configPath, _outputPath, _includeStackTrackInOutput, _format);
                            rdfER.Start();
                            rdfER.Dispose();
                            rdfER = null;
                        }
                    }
                }
                else
                {
                    //Split!!!!

                    //get the split details from config and setup
                    GetSplitConfig();

                    //Split the main data file into the number specified in the config
                    var splitter = new XmlSplitter(_dataPath, _inputChunkingFolder);

                    //do split
                    Console.WriteLine("Splitting original file...");
                    splitter.Split(_splitType, _splitSize, _fileSuffixXpath);
                    Console.Write(splitter.SplitTotal + " files.");
                    splitter = null;

                    //now that all of the files are split, lets iterate through each file and
                    Console.WriteLine("Starting RDFing...");
                    //string[] splitFiles = ;
                    foreach (string split in Directory.GetFiles(_inputChunkingFolder))
                    {
                        Console.WriteLine("RDFing: " + split);
                        var rdfER = new RDFer(split, _configPath, _outputChunkingFolder, _includeStackTrackInOutput, _format);
                        rdfER.Start();
                        rdfER.Dispose();
                        rdfER = null;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("RDFing error:");
                Console.WriteLine(ex.Message + (_includeStackTrackInOutput ? ex.StackTrace : ""));
            }
            finally
            {
                //if user requested application to pause then do so
                if (_pause)
                {
                    Console.WriteLine("RDFing finished.  Press return to end.");
                    Console.Read();
                }
                else
                {
                    Console.WriteLine("RDFing finished");
                }
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            PrintTitle();
            GetAndCheckArgs(args);

            //if we get here, all required params are met
            try
            {
                //no split
                if (!_split)
                {
                    Console.WriteLine("Starting RDFing...");

                    if (_isSingleFile)
                    {
                        var rdfER = new RDFer(_dataPath, _configPath, _outputPath, _includeStackTrackInOutput,_format);
                        rdfER.Start();
                        rdfER.Dispose();
                        rdfER = null;
                    }
                    else if (_isDirectoryOfFiles)
                    {
                        List<string> inputFiles = GetAllInputFiles(_dataPath, new List<string>());

                        foreach (string inputFile in inputFiles)
                        {
                            Console.WriteLine("Processing File: " + inputFile);
                            var rdfER = new RDFer(inputFile, _configPath, _outputPath, _includeStackTrackInOutput, _format);
                            rdfER.Start();
                            rdfER.Dispose();
                            rdfER = null;
                        }
                    }
                }
                else
                {
                    //Split!!!!

                    //get the split details from config and setup
                    GetSplitConfig();

                    //Split the main data file into the number specified in the config
                    var splitter = new XmlSplitter(_dataPath, _inputChunkingFolder);

                    //do split
                    Console.WriteLine("Splitting original file...");
                    splitter.Split(_splitType, _splitSize,_fileSuffixXpath);
                    Console.Write(splitter.SplitTotal + " files.");
                    splitter = null;

                    //now that all of the files are split, lets iterate through each file and
                    Console.WriteLine("Starting RDFing...");
                    //string[] splitFiles = ;
                    foreach (string split in Directory.GetFiles(_inputChunkingFolder))
                    {
                        Console.WriteLine("RDFing: " + split);
                        var rdfER = new RDFer(split, _configPath, _outputChunkingFolder, _includeStackTrackInOutput, _format);
                        rdfER.Start();
                        rdfER.Dispose();
                        rdfER = null;

                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("RDFing error:");
                Console.WriteLine(ex.Message + (_includeStackTrackInOutput ? ex.StackTrace : ""));
            }
            finally
            {
                //if user requested application to pause then do so
                if (_pause)
                {
                    Console.WriteLine("RDFing finished.  Press return to end.");
                    Console.Read();
                }
                else
                {
                    Console.WriteLine("RDFing finished");
                }
            }
        }