Esempio n. 1
0
        /// <summary> Builds persistent index from given parameters. </summary>
        /// <param name="filePath">Path to map data file.</param>
        /// <param name="outputDirectory">Output directory for index files.</param>
        public void BuildIndex(string filePath, string outputDirectory)
        {
            if (!outputDirectory.StartsWith(_indexRootFolder))
            {
                Trace.Warn("index.mngr", Strings.MapIndexBuildOutputDirectoryMismatch);
            }

            // create directory for output files
            _fileSystemService.CreateDirectory(outputDirectory);

            // read settings
            var jsonContent = _fileSystemService.ReadText(_indexSettingsPath);
            var node        = JSON.Parse(jsonContent);

            var settings = new IndexSettings();

            settings.ReadFromJson(node);

            // create builder from given parameters
            var builder = new PersistentIndexBuilder(filePath, outputDirectory,
                                                     _fileSystemService, settings, _objectPool, Trace);

            // build
            builder.Build();
        }
Esempio n. 2
0
        public void SetUpFixture()
        {
            _xmlContent = File.ReadAllText(TestHelper.BerlinXmlData);
            var settings = new IndexSettings();

            settings.ReadFromJson(JSON.Parse(File.ReadAllText(TestHelper.TestIndexSettingsPath)));
            _indexBuilder = new TestableIndexBuilder(settings, TestHelper.GetObjectPool(), new ConsoleTrace());
        }
Esempio n. 3
0
 public void SetUp()
 {
     _settings = new IndexSettings();
     using (var reader = new StreamReader(File.Open(TestHelper.TestIndexSettingsPath, FileMode.Open)))
     {
         var jsonNode = JSON.Parse(reader.ReadToEnd());
         _settings.ReadFromJson(jsonNode);
     }
 }