diff options
author | vng <viktor.govako@gmail.com> | 2015-03-13 14:43:04 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:39:02 +0300 |
commit | 70b1f7b8f702739d3a3c1e7f8ea7d5f3368d82af (patch) | |
tree | 788e68da004d7b48af2b85dc8ea832b71fee4847 /indexer/scale_index_builder.hpp | |
parent | 770e03274c0bd636831eb5f5429024c6eb2bfc5f (diff) |
[generator] Correct work with FilesContainerR/W.
Diffstat (limited to 'indexer/scale_index_builder.hpp')
-rw-r--r-- | indexer/scale_index_builder.hpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/indexer/scale_index_builder.hpp b/indexer/scale_index_builder.hpp index 24a48874d8..9dd6258358 100644 --- a/indexer/scale_index_builder.hpp +++ b/indexer/scale_index_builder.hpp @@ -6,6 +6,8 @@ #include "interval_index_builder.hpp" #include "cell_id.hpp" +#include "../defines.hpp" + #include "../coding/dd_vector.hpp" #include "../coding/file_sort.hpp" #include "../coding/var_serial_vector.hpp" @@ -147,12 +149,13 @@ inline void IndexScales(uint32_t bucketsCount, LOG(LINFO, ("Building scale index for bucket:", bucket)); uint32_t numFeatures = 0; + string const cells2featureFile = tmpFilePrefix + CELL2FEATURE_SORTED_EXT; { - FileWriter cellsToFeaturesWriter(tmpFilePrefix + ".c2f.sorted"); + FileWriter cellsToFeaturesWriter(cells2featureFile); typedef FileSorter<CellFeaturePair, WriterFunctor<FileWriter> > SorterType; WriterFunctor<FileWriter> out(cellsToFeaturesWriter); - SorterType sorter(1024*1024, tmpFilePrefix + ".c2f.tmp", out); + SorterType sorter(1024*1024, tmpFilePrefix + CELL2FEATURE_TMP_EXT, out); featuresVector.ForEachOffset( FeatureCoverer<SorterType>(skipped, bucket, codingScale, sorter, numFeatures)); // LOG(LINFO, ("Sorting...")); @@ -161,7 +164,7 @@ inline void IndexScales(uint32_t bucketsCount, // LOG(LINFO, ("Indexing...")); { - FileReader reader(tmpFilePrefix + ".c2f.sorted"); + FileReader reader(cells2featureFile); uint64_t const numCells = reader.Size() / sizeof(CellFeaturePair); DDVector<CellFeaturePair, FileReader, uint64_t> cellsToFeatures(reader); LOG(LINFO, ("Being indexed", "features:", numFeatures, "cells:", numCells, @@ -171,7 +174,7 @@ inline void IndexScales(uint32_t bucketsCount, RectId::DEPTH_LEVELS * 2 + 1); } - FileWriter::DeleteFileX(tmpFilePrefix + ".c2f.sorted"); + FileWriter::DeleteFileX(cells2featureFile); // LOG(LINFO, ("Indexing done.")); recordWriter.FinishRecord(); } |