diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-31 20:11:14 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-31 20:11:14 +0200 |
commit | de6a41c82f0aa8ce6ed0eebcf4dbb93f102a9271 (patch) | |
tree | f005b875ba315293778a2705ccccd073099b35ac /searchcorespi | |
parent | 04d0e0e385671da5d4298a7d23cae57e3f5114f8 (diff) |
Reduce fastos.h dependency.
Diffstat (limited to 'searchcorespi')
20 files changed, 53 insertions, 109 deletions
diff --git a/searchcorespi/src/vespa/searchcorespi/flush/flushstats.cpp b/searchcorespi/src/vespa/searchcorespi/flush/flushstats.cpp index 29318809335..0b55ac58428 100644 --- a/searchcorespi/src/vespa/searchcorespi/flush/flushstats.cpp +++ b/searchcorespi/src/vespa/searchcorespi/flush/flushstats.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.flush.flushstats"); #include "flushstats.h" diff --git a/searchcorespi/src/vespa/searchcorespi/index/activediskindexes.cpp b/searchcorespi/src/vespa/searchcorespi/index/activediskindexes.cpp index 73bda4d94c8..95c0df6cde6 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/activediskindexes.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/activediskindexes.cpp @@ -1,17 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.index.activediskindexes"); - #include "activediskindexes.h" using std::set; using vespalib::string; using vespalib::LockGuard; -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { void ActiveDiskIndexes::setActive(const string &index) { LockGuard lock(_lock); @@ -30,5 +25,4 @@ bool ActiveDiskIndexes::isActive(const string &index) const { return _active.find(index) != _active.end(); } -} // namespace index -} // namespace searchcorespi +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/disk_index_stats.cpp b/searchcorespi/src/vespa/searchcorespi/index/disk_index_stats.cpp index f9d5215d6f5..b627ddee271 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/disk_index_stats.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/disk_index_stats.cpp @@ -1,12 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include "disk_index_stats.h" #include "idiskindex.h" -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { DiskIndexStats::DiskIndexStats() : IndexSearchableStats(), @@ -24,5 +22,4 @@ DiskIndexStats::~DiskIndexStats() { } -} // namespace searchcorespi::index -} // namespace searchcorespi +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/diskindexcleaner.cpp b/searchcorespi/src/vespa/searchcorespi/index/diskindexcleaner.cpp index 68e7853c820..d2788ed558a 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/diskindexcleaner.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/diskindexcleaner.cpp @@ -1,21 +1,20 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.index.diskindexcleaner"); - -#include "activediskindexes.h" #include "diskindexcleaner.h" -#include <algorithm> +#include "activediskindexes.h" +#include <vespa/fastos/file.h> #include <sstream> #include <vector> +#include <vespa/log/log.h> +LOG_SETUP(".searchcorespi.index.diskindexcleaner"); + using std::istringstream; using vespalib::string; using std::vector; -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { + namespace { vector<string> readIndexes(const string &base_dir) { vector<string> indexes; @@ -109,5 +108,5 @@ void DiskIndexCleaner::removeOldIndexes( vector<string> indexes = readIndexes(base_dir); removeOld(base_dir, indexes, active_indexes); } -} // namespace index -} // namespace searchcorespi + +}
\ No newline at end of file diff --git a/searchcorespi/src/vespa/searchcorespi/index/eventlogger.cpp b/searchcorespi/src/vespa/searchcorespi/index/eventlogger.cpp index c5e4a382233..4a640f16389 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/eventlogger.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/eventlogger.cpp @@ -1,16 +1,15 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.index.eventlogger"); #include "eventlogger.h" #include <vespa/searchlib/util/logutil.h> +#include <vespa/log/log.h> +LOG_SETUP(".searchcorespi.index.eventlogger"); + using vespalib::JSONStringer; using search::util::LogUtil; -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { void EventLogger::diskIndexLoadStart(const vespalib::string &indexDir) @@ -67,5 +66,4 @@ EventLogger::diskFusionComplete(const vespalib::string &fusionDir, EV_STATE("fusion.complete", jstr.toString().c_str()); } -} // namespace index -} // namespace searchcorespi +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/fusionrunner.cpp b/searchcorespi/src/vespa/searchcorespi/index/fusionrunner.cpp index 84c34714526..8c7a1851f42 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/fusionrunner.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/fusionrunner.cpp @@ -1,9 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.index.fusionrunner"); - #include "fusionrunner.h" #include "eventlogger.h" #include "fusionspec.h" @@ -13,6 +9,9 @@ LOG_SETUP(".searchcorespi.index.fusionrunner"); #include <vespa/searchlib/util/dirtraverse.h> #include <vespa/vespalib/util/jsonwriter.h> +#include <vespa/log/log.h> +LOG_SETUP(".searchcorespi.index.fusionrunner"); + using search::FixedSourceSelector; using search::TuneFileAttributes; using search::TuneFileIndexing; @@ -26,8 +25,7 @@ using std::vector; using vespalib::string; using vespalib::JSONStringer; -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { FusionRunner::FusionRunner(const string &base_dir, const Schema &schema, @@ -130,5 +128,4 @@ FusionRunner::fuse(const FusionSpec &fusion_spec, return fusion_id; } -} // namespace index -} // namespace searchcorespi +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/fusionspec.h b/searchcorespi/src/vespa/searchcorespi/index/fusionspec.h index 5e31698a7fc..f5c6006eb2d 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/fusionspec.h +++ b/searchcorespi/src/vespa/searchcorespi/index/fusionspec.h @@ -2,10 +2,10 @@ #pragma once +#include <cstdint> #include <vector> -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { /** * Specifies a set of disk index ids for fusion. @@ -19,6 +19,4 @@ struct FusionSpec { FusionSpec() : last_fusion_id(0), flush_ids() {} }; -} // namespace index -} // namespace searchcorespi - +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/index_manager_explorer.cpp b/searchcorespi/src/vespa/searchcorespi/index/index_manager_explorer.cpp index 7920c1650cb..ed2e4601963 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/index_manager_explorer.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/index_manager_explorer.cpp @@ -1,8 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.index.index_manager_explorer"); #include "index_manager_explorer.h" #include "index_manager_stats.h" diff --git a/searchcorespi/src/vespa/searchcorespi/index/index_manager_stats.cpp b/searchcorespi/src/vespa/searchcorespi/index/index_manager_stats.cpp index 035a5698c2f..6493fb7fcaa 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/index_manager_stats.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/index_manager_stats.cpp @@ -1,11 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include "index_manager_stats.h" #include "iindexmanager.h" #include "indexsearchablevisitor.h" - namespace searchcorespi { namespace { diff --git a/searchcorespi/src/vespa/searchcorespi/index/index_manager_stats.h b/searchcorespi/src/vespa/searchcorespi/index/index_manager_stats.h index 048124b688f..637dcafdfbe 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/index_manager_stats.h +++ b/searchcorespi/src/vespa/searchcorespi/index/index_manager_stats.h @@ -3,6 +3,7 @@ #include "disk_index_stats.h" #include "memory_index_stats.h" +#include <vector> namespace searchcorespi { diff --git a/searchcorespi/src/vespa/searchcorespi/index/index_searchable_stats.cpp b/searchcorespi/src/vespa/searchcorespi/index/index_searchable_stats.cpp index c5ce5163aac..1d72340e79c 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/index_searchable_stats.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/index_searchable_stats.cpp @@ -1,12 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include "index_searchable_stats.h" #include "indexsearchable.h" -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { IndexSearchableStats::IndexSearchableStats() : _serialNum(0), @@ -26,4 +24,3 @@ bool IndexSearchableStats::operator<(const IndexSearchableStats &rhs) const } } // namespace searchcorespi::index -} // namespace searchcorespi diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexdisklayout.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexdisklayout.cpp index f886f7eb536..a0fdefe7e8b 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexdisklayout.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexdisklayout.cpp @@ -1,13 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.index.indexdisklayout"); #include "indexdisklayout.h" #include <sstream> -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { const vespalib::string IndexDiskLayout::FlushDirPrefix = vespalib::string("index.flush."); @@ -57,6 +53,4 @@ IndexDiskLayout::getSelectorFileName(const vespalib::string &dir) return dir + "/selector"; } -} // namespace index -} // namespace searchcorespi - +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp index 84ce5b77bef..1384d5bf868 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp @@ -1,15 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.index.indexmaintainerconfig"); #include "indexmaintainerconfig.h" using search::index::Schema; using search::TuneFileAttributes; -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { IndexMaintainerConfig::IndexMaintainerConfig(const vespalib::string &baseDir, const WarmupConfig & warmup, @@ -26,6 +22,6 @@ IndexMaintainerConfig::IndexMaintainerConfig(const vespalib::string &baseDir, { } -} // namespace index -} // namespace searchcorespi +IndexMaintainerConfig::~IndexMaintainerConfig() { } +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h index ea51399bcd7..58c58af7328 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h @@ -1,14 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchcommon/common/schema.h> +#include "warmupconfig.h" #include <vespa/searchlib/common/tunefileinfo.h> #include <vespa/searchlib/common/serialnum.h> +#include <vespa/searchcommon/common/schema.h> #include <vespa/vespalib/stllike/string.h> -#include "warmupconfig.h" -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { /** * Class that keeps the config used when constructing an index maintainer. @@ -30,6 +29,8 @@ public: const search::SerialNum serialNum, const search::TuneFileAttributes &tuneFileAttributes); + ~IndexMaintainerConfig(); + /** * Returns the base directory in which the maintainer will store its indexes. */ @@ -60,7 +61,4 @@ public: } }; -} // namespace index -} // namespace searchcorespi - - +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.cpp index d18920f5c7a..c04815c8bec 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.index.indexmaintainercontext"); #include "indexmaintainercontext.h" @@ -9,8 +6,7 @@ using search::common::FileHeaderContext; using search::TuneFileAttributes; using searchcorespi::IIndexManager; -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { IndexMaintainerContext::IndexMaintainerContext(IThreadingService &threadingService, IIndexManager::Reconfigurer &reconfigurer, @@ -23,6 +19,4 @@ IndexMaintainerContext::IndexMaintainerContext(IThreadingService &threadingServi { } -} // namespace index -} // namespace searchcorespi - +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.h index ee8087bef99..4804e0a77f5 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.h +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.h @@ -2,13 +2,12 @@ #pragma once #include "ithreadingservice.h" -#include <vespa/searchcorespi/index/iindexmanager.h> +#include "iindexmanager.h" #include <vespa/searchlib/common/tunefileinfo.h> #include <vespa/searchlib/common/fileheadercontext.h> #include <vespa/vespalib/util/threadexecutor.h> -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { /** * Class that keeps the long-lived context used by an index maintainer. @@ -53,7 +52,4 @@ public: vespalib::ThreadExecutor & getWarmupExecutor() const { return _warmupExecutor; } }; -} // namespace index -} // namespace searchcorespi - - +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmanagerconfig.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmanagerconfig.cpp index 830e4f68c45..8d6bf807049 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmanagerconfig.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmanagerconfig.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.index.indexmanagerconfig"); #include "indexmanagerconfig.h" @@ -16,5 +13,7 @@ IndexManagerConfig::IndexManagerConfig(const vespalib::string &configId, { } +IndexManagerConfig::~IndexManagerConfig() { } + } // namespace searchcorespi diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmanagerconfig.h b/searchcorespi/src/vespa/searchcorespi/index/indexmanagerconfig.h index 7019a10668a..1a6ff8f1cba 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmanagerconfig.h +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmanagerconfig.h @@ -19,6 +19,7 @@ public: IndexManagerConfig(const vespalib::string &configId, const config::ConfigSnapshot &configSnapshot, size_t numSearcherThreads); + ~IndexManagerConfig(); /** * Returns the config id used to retrieve the configs from the config snapshot instance. diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexreadutilities.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexreadutilities.cpp index d2c76612833..0f002c7282f 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexreadutilities.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexreadutilities.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".searchcorespi.index.indexreadutilities"); #include "indexreadutilities.h" #include "indexdisklayout.h" @@ -10,11 +7,13 @@ LOG_SETUP(".searchcorespi.index.indexreadutilities"); #include <set> #include <vector> +#include <vespa/log/log.h> +LOG_SETUP(".searchcorespi.index.indexreadutilities"); + using search::SerialNum; using vespalib::FileHeader; -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { namespace { @@ -86,6 +85,4 @@ IndexReadUtilities::readSerialNum(const vespalib::string &dir) return 0; } -} // namespace index -} // namespace searchcorespi - +} diff --git a/searchcorespi/src/vespa/searchcorespi/index/memory_index_stats.cpp b/searchcorespi/src/vespa/searchcorespi/index/memory_index_stats.cpp index 7805702fd03..2b090e7fd62 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/memory_index_stats.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/memory_index_stats.cpp @@ -1,12 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include "memory_index_stats.h" #include "imemoryindex.h" - -namespace searchcorespi { -namespace index { +namespace searchcorespi::index { MemoryIndexStats::MemoryIndexStats() : IndexSearchableStats() @@ -23,4 +20,3 @@ MemoryIndexStats::~MemoryIndexStats() } } // namespace searchcorespi::index -} // namespace searchcorespi |