diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-08 22:57:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-08 22:57:39 +0100 |
commit | 97c338a8d5422fc6fc64ff4f1433104c694b6a84 (patch) | |
tree | bf480def128948db8232b258f616c574b41c617c | |
parent | c097f2f22e032aba47e80e5588f24c4da2a14fcc (diff) | |
parent | b20e63f9506c37e73e46e8e879078ed69c639a5e (diff) |
Merge pull request #21586 from vespa-engine/balder/gc-unused-threadpool
Balder/gc unused threadpool
40 files changed, 50 insertions, 557 deletions
diff --git a/document/src/vespa/document/fieldvalue/stringfieldvalue.h b/document/src/vespa/document/fieldvalue/stringfieldvalue.h index 17a0302f6f9..07e9e578692 100644 --- a/document/src/vespa/document/fieldvalue/stringfieldvalue.h +++ b/document/src/vespa/document/fieldvalue/stringfieldvalue.h @@ -11,7 +11,6 @@ #include <vespa/document/annotation/spantree.h> #include <vespa/vespalib/stllike/hash_map.h> #include <vespa/vespalib/util/buffer.h> -#include <vespa/fastos/dynamiclibrary.h> namespace document { diff --git a/fastos/src/vespa/fastos/CMakeLists.txt b/fastos/src/vespa/fastos/CMakeLists.txt index 623d931e999..605b1e40a38 100644 --- a/fastos/src/vespa/fastos/CMakeLists.txt +++ b/fastos/src/vespa/fastos/CMakeLists.txt @@ -8,7 +8,6 @@ vespa_add_library(fastos_objects OBJECT linux_file.cpp thread.cpp unix_app.cpp - unix_dynamiclibrary.cpp unix_file.cpp unix_thread.cpp ) diff --git a/fastos/src/vespa/fastos/app.cpp b/fastos/src/vespa/fastos/app.cpp index 94e467d341d..05e885a7d37 100644 --- a/fastos/src/vespa/fastos/app.cpp +++ b/fastos/src/vespa/fastos/app.cpp @@ -12,13 +12,7 @@ #include <cstring> #include <fcntl.h> -FastOS_ThreadPool *FastOS_ApplicationInterface::GetThreadPool () -{ - return _threadPool; -} - FastOS_ApplicationInterface::FastOS_ApplicationInterface() : - _threadPool(nullptr), _argc(0), _argv(nullptr) { @@ -44,13 +38,10 @@ bool FastOS_ApplicationInterface::Init () if (PreThreadInit()) { if (FastOS_Thread::InitializeClass()) { - if (FastOS_File::InitializeClass()) { - _threadPool = new FastOS_ThreadPool(128 * 1024); - rc = true; - } else - fprintf(stderr, "FastOS_File class initialization failed.\n"); - } else + rc = true; + } else { fprintf(stderr, "FastOS_Thread class initialization failed.\n"); + } } else fprintf(stderr, "FastOS_PreThreadInit failed.\n"); @@ -60,12 +51,6 @@ bool FastOS_ApplicationInterface::Init () void FastOS_ApplicationInterface::Cleanup () { - if(_threadPool != nullptr) { - _threadPool->Close(); - delete _threadPool; - _threadPool = nullptr; - } - FastOS_File::CleanupClass(); FastOS_Thread::CleanupClass(); } diff --git a/fastos/src/vespa/fastos/app.h b/fastos/src/vespa/fastos/app.h index 6aa7a9346ed..c03dbc5848c 100644 --- a/fastos/src/vespa/fastos/app.h +++ b/fastos/src/vespa/fastos/app.h @@ -10,11 +10,7 @@ #pragma once -#include <vespa/fastos/types.h> - -class FastOS_ThreadPool; - -#include <mutex> +#include "types.h" /** * FastOS application wrapper class. @@ -125,14 +121,7 @@ class FastOS_ThreadPool; class FastOS_ApplicationInterface { friend int main (int argc, char **argv); - -private: - FastOS_ApplicationInterface(const FastOS_ApplicationInterface&); - FastOS_ApplicationInterface& operator=(const FastOS_ApplicationInterface&); - protected: - FastOS_ThreadPool *_threadPool; - virtual bool PreThreadInit () { return true; } public: @@ -140,7 +129,8 @@ public: char **_argv; FastOS_ApplicationInterface(); - + FastOS_ApplicationInterface(const FastOS_ApplicationInterface&) = delete; + FastOS_ApplicationInterface& operator=(const FastOS_ApplicationInterface&) = delete; virtual ~FastOS_ApplicationInterface(); /** @@ -182,8 +172,6 @@ public: * of @ref Init() and @ref Main(). */ virtual void Cleanup (); - - FastOS_ThreadPool *GetThreadPool (); }; diff --git a/fastos/src/vespa/fastos/dynamiclibrary.h b/fastos/src/vespa/fastos/dynamiclibrary.h deleted file mode 100644 index 6762ad4ac76..00000000000 --- a/fastos/src/vespa/fastos/dynamiclibrary.h +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/****************************************************************-*-C++-*- - * @file - * Class definitions for FastOS_DynamicLibrary. - * - * @author Eyvind Bernhardsen - * - * Creation date : 2003-07-02 - *************************************************************************/ - - - -#pragma once - - -#include <vespa/fastos/types.h> -#include <string> - -/** - * This class contains functionality to load, get symbols from and - * unload dynamic libraries. - */ - -class FastOS_DynamicLibraryInterface -{ -public: - /** - * Destructor. The destructor will close the library if it is open. - */ - virtual ~FastOS_DynamicLibraryInterface() {} - - /** - * Open (load) the library. - * @param libname the name of the library to open - * @return Boolean success/failure - */ - virtual bool Open(const char *libname = nullptr) = 0; - - /** - * Close (unload) the library. - * @return Boolean success/failure - */ - virtual bool Close() = 0; - - /** - * Find the address of a symbol in the library. - * @param symbol Name of symbol to find - * @return Address of the symbol, or nullptr if an error has occurred - */ - virtual void * GetSymbol(const char *symbol) const = 0; - - /** - * Check if the library is open. - * @return true if it is, false if it ain't - */ - virtual bool IsOpen() const = 0; - - /** - * Return an error message describing the last error. This is - * currently platform-dependent, unfortunately; FastOS does not - * normalize the error messages. - * @return The error string if an error has occurred since the last - * invocation, or an empty one if no error has occurred. - */ - std::string GetLastErrorString(); -}; - - -# include "unix_dynamiclibrary.h" -typedef FastOS_UNIX_DynamicLibrary FASTOS_PREFIX(DynamicLibrary); - -/********************************************************************* - * Dynamic library helper macros: - * - * FASTOS_LOADABLE_EXPORT prefix that marks a symbol to be exported - * FASTOS_LOADABLE_IMPORT prefix that marks a symbol to be imported - * from a dll - * FASTOS_LOADABLE_FACTORY macro that creates and exports a function - * called factory. The macro takes a class - * name as its only parameter, and the - * factory function returns a pointer to an - * instance of that class. - * - * Example usage: - * loadableclass.h: - * class FastOS_LoadableClass - * { - * public: - * void DoSomething(); - * } - * - * in loadableclass.cpp: - * FASTOS_LOADABLE_FACTORY(LoadableClass) - *********************************************************************/ - - -# define FASTOS_LOADABLE_EXPORT - -# define FASTOS_LOADABLE_IMPORT - -#define FASTOS_LOADABLE_FACTORY(loadable_class) \ -extern "C" { \ - FASTOS_LOADABLE_EXPORT loadable_class *factory() { \ - return new loadable_class; \ - } \ -} - -// New macros to support the new gcc visibility features. - -#define VESPA_DLL_EXPORT __attribute__ ((visibility("default"))) -#define VESPA_DLL_LOCAL __attribute__ ((visibility("hidden"))) diff --git a/fastos/src/vespa/fastos/file.cpp b/fastos/src/vespa/fastos/file.cpp index 4f585e7daeb..ca109d831a8 100644 --- a/fastos/src/vespa/fastos/file.cpp +++ b/fastos/src/vespa/fastos/file.cpp @@ -52,16 +52,6 @@ FastOS_FileInterface::FastOS_FileInterface(const char *filename) FastOS_FileInterface::~FastOS_FileInterface() = default; -bool FastOS_FileInterface::InitializeClass () -{ - return true; -} - -bool FastOS_FileInterface::CleanupClass () -{ - return true; -} - void FastOS_FileInterface::ReadBuf(void *buffer, size_t length) { diff --git a/fastos/src/vespa/fastos/file.h b/fastos/src/vespa/fastos/file.h index 238da364d54..b5e1add3529 100644 --- a/fastos/src/vespa/fastos/file.h +++ b/fastos/src/vespa/fastos/file.h @@ -99,20 +99,6 @@ public: void setFAdviseOptions(int options) { _fAdviseOptions = options; } /** - * Initialize the file class. This is invoked by - * @ref FastOS_Application::Init(). - * @return Boolean success/failure - */ - static bool InitializeClass (); - - /** - * Cleanup the file class. This is invoked by - * @ref FastOS_Application::Cleanup(). - * @return Boolean success/failure - */ - static bool CleanupClass (); - - /** * Copy a single file. Will overwrite destination if it already exists. * * @author Sveinar Rasmussen diff --git a/fastos/src/vespa/fastos/linux_file.cpp b/fastos/src/vespa/fastos/linux_file.cpp index 1074c02b4ac..6b58006eb62 100644 --- a/fastos/src/vespa/fastos/linux_file.cpp +++ b/fastos/src/vespa/fastos/linux_file.cpp @@ -413,13 +413,6 @@ FastOS_Linux_File::Open(unsigned int openFlags, const char *filename) return rc; } - -bool -FastOS_Linux_File::InitializeClass() -{ - return FastOS_UNIX_File::InitializeClass(); -} - int FastOS_Linux_File::count_open_files() { diff --git a/fastos/src/vespa/fastos/linux_file.h b/fastos/src/vespa/fastos/linux_file.h index f3c66d49f12..567af9e8ab0 100644 --- a/fastos/src/vespa/fastos/linux_file.h +++ b/fastos/src/vespa/fastos/linux_file.h @@ -40,7 +40,6 @@ public: [[nodiscard]] ssize_t Write2(const void *buffer, size_t len) override; bool Open(unsigned int openFlags, const char *filename) override; - static bool InitializeClass(); static size_t getMaxDirectIOMemAlign(); static int count_open_files(); private: diff --git a/fastos/src/vespa/fastos/ringbuffer.h b/fastos/src/vespa/fastos/ringbuffer.h deleted file mode 100644 index e442faa1921..00000000000 --- a/fastos/src/vespa/fastos/ringbuffer.h +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma once - -struct FastOS_RingBufferData -{ - union - { - unsigned int _messageSize; - uint8_t _buffer[1]; - }; -}; - - -class FastOS_RingBuffer -{ -private: - FastOS_RingBuffer (const FastOS_RingBuffer&); - FastOS_RingBuffer& operator=(const FastOS_RingBuffer&); - - bool _closed; - FastOS_RingBufferData *_data; - int _bufferSize; - int _dataIndex, _dataSize; - - int GetWriteIndex (int offset) - { - return (_dataIndex + _dataSize + offset) % _bufferSize; - } - - int GetReadIndex (int offset) - { - return (_dataIndex + offset) % _bufferSize; - } - - std::mutex _mutex; - -public: - void Reset () - { - _dataIndex = 0; - _dataSize = 0; - _closed = false; - } - - FastOS_RingBuffer (int bufferSize) - : _closed(false), - _data(0), - _bufferSize(bufferSize), - _dataIndex(0), - _dataSize(0), - _mutex() - { - _data = static_cast<FastOS_RingBufferData *> - (malloc(sizeof(FastOS_RingBufferData) + bufferSize)); - Reset(); - } - - ~FastOS_RingBuffer () - { - free(_data); - } - - uint8_t *GetWritePtr (int offset=0) - { - return &_data->_buffer[GetWriteIndex(offset)]; - } - - uint8_t *GetReadPtr (int offset=0) - { - return &_data->_buffer[GetReadIndex(offset)]; - } - - void Consume (int bytes) - { - _dataSize -= bytes; - _dataIndex = (_dataIndex + bytes) % _bufferSize; - } - - void Produce (int bytes) - { - _dataSize += bytes; - } - - int GetWriteSpace () - { - int spaceLeft = _bufferSize - _dataSize; - int continuousBufferLeft = _bufferSize - GetWriteIndex(0); - - if(continuousBufferLeft > spaceLeft) - continuousBufferLeft = spaceLeft; - - return continuousBufferLeft; - } - - int GetReadSpace () - { - int dataLeft = _dataSize; - int continuousBufferLeft = _bufferSize - _dataIndex; - if(continuousBufferLeft > dataLeft) - continuousBufferLeft = dataLeft; - return continuousBufferLeft; - } - - void Close () - { - _closed = true; - } - - bool GetCloseFlag () - { - return _closed; - } - - std::unique_lock<std::mutex> getGuard() { return std::unique_lock<std::mutex>(_mutex); } -}; - diff --git a/fastos/src/vespa/fastos/types.h b/fastos/src/vespa/fastos/types.h index a0806204e66..69dd3e5231c 100644 --- a/fastos/src/vespa/fastos/types.h +++ b/fastos/src/vespa/fastos/types.h @@ -4,3 +4,6 @@ #define FASTOS_PREFIX(a) FastOS_##a +// New macros to support the new gcc visibility features. +#define VESPA_DLL_EXPORT __attribute__ ((visibility("default"))) +#define VESPA_DLL_LOCAL __attribute__ ((visibility("hidden"))) diff --git a/fastos/src/vespa/fastos/unix_app.cpp b/fastos/src/vespa/fastos/unix_app.cpp index e94525fff22..6b1ff743506 100644 --- a/fastos/src/vespa/fastos/unix_app.cpp +++ b/fastos/src/vespa/fastos/unix_app.cpp @@ -23,9 +23,7 @@ extern char **environ; }; int -FastOS_UNIX_Application::GetOpt (const char *optionsString, - const char* &optionArgument, - int &optionIndex) +FastOS_UNIX_Application::GetOpt (const char *optionsString, const char* &optionArgument, int &optionIndex) { int rc = getopt(_argc, _argv, optionsString); optionArgument = optarg; @@ -34,16 +32,10 @@ FastOS_UNIX_Application::GetOpt (const char *optionsString, } int -FastOS_UNIX_Application::GetOptLong(const char *optionsString, - const char* &optionArgument, - int &optionIndex, - const struct option *longopts, - int *longindex) +FastOS_UNIX_Application::GetOptLong(const char *optionsString, const char* &optionArgument, int &optionIndex, + const struct option *longopts,int *longindex) { - int rc = getopt_long(_argc, _argv, optionsString, - longopts, - longindex); - + int rc = getopt_long(_argc, _argv, optionsString, longopts, longindex); optionArgument = optarg; optionIndex = optind; return rc; @@ -74,14 +66,7 @@ bool FastOS_UNIX_Application::PreThreadInit () bool FastOS_UNIX_Application::Init () { - bool rc = false; - - if(FastOS_ApplicationInterface::Init()) - { - rc = true; - } - - return rc; + return FastOS_ApplicationInterface::Init(); } void FastOS_UNIX_Application::Cleanup () diff --git a/fastos/src/vespa/fastos/unix_app.h b/fastos/src/vespa/fastos/unix_app.h index 5e076f4482b..beb494b4fea 100644 --- a/fastos/src/vespa/fastos/unix_app.h +++ b/fastos/src/vespa/fastos/unix_app.h @@ -8,9 +8,8 @@ #pragma once - -#include "types.h" #include "app.h" +#include "types.h" #include <memory> /** @@ -18,14 +17,12 @@ */ class FastOS_UNIX_Application : public FastOS_ApplicationInterface { -private: - FastOS_UNIX_Application(const FastOS_UNIX_Application&); - FastOS_UNIX_Application& operator=(const FastOS_UNIX_Application&); - protected: bool PreThreadInit () override; public: FastOS_UNIX_Application (); + FastOS_UNIX_Application(const FastOS_UNIX_Application&) = delete; + FastOS_UNIX_Application& operator=(const FastOS_UNIX_Application&) = delete; virtual ~FastOS_UNIX_Application(); /** diff --git a/fastos/src/vespa/fastos/unix_dynamiclibrary.cpp b/fastos/src/vespa/fastos/unix_dynamiclibrary.cpp deleted file mode 100644 index 68e00010211..00000000000 --- a/fastos/src/vespa/fastos/unix_dynamiclibrary.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/dynamiclibrary.h> -#include <vespa/fastos/file.h> - -#include <dlfcn.h> - -namespace { -const std::string FASTOS_DYNLIB_PREFIX("lib"); -#ifdef __APPLE__ -const std::string FASTOS_DYNLIB_SUFFIX(".dylib"); -#else -const std::string FASTOS_DYNLIB_SUFFIX(".so"); -const std::string FASTOS_DYNLIB_SUFPREFIX(".so."); -#endif - -bool hasValidSuffix(const std::string & s) -{ - if (s.rfind(FASTOS_DYNLIB_SUFFIX) == (s.size() - FASTOS_DYNLIB_SUFFIX.size())) { - return true; - } -#ifndef __APPLE__ - if (s.rfind(FASTOS_DYNLIB_SUFPREFIX) != std::string::npos) { - return true; - } -#endif - return false; -} - -} - -void -FastOS_UNIX_DynamicLibrary::SetLibName(const char *libname) -{ - if (libname != nullptr) { - _libname = libname; - if ( ! hasValidSuffix(_libname)) { - _libname.append(FASTOS_DYNLIB_SUFFIX); - } - } else { - _libname = ""; - } -} - -bool -FastOS_UNIX_DynamicLibrary::NormalizeLibName(void) -{ - bool returnCode = false; - std::string::size_type pathPos = _libname.rfind(FastOS_File::GetPathSeparator()[0]); - std::string tmp = (pathPos != std::string::npos) - ? _libname.substr(pathPos+1) - : _libname; - if (tmp.find(FASTOS_DYNLIB_PREFIX) != 0) { - tmp = FASTOS_DYNLIB_PREFIX + tmp; - if (pathPos != std::string::npos) { - tmp = _libname.substr(0, pathPos); - } - SetLibName(tmp.c_str()); - returnCode = true; - } - - return returnCode; -} - -bool -FastOS_UNIX_DynamicLibrary::Close() -{ - bool retcode = true; - - if (IsOpen()) { - retcode = (dlclose(_handle) == 0); - if (retcode) - _handle = nullptr; - } - - return retcode; -} - -FastOS_UNIX_DynamicLibrary::FastOS_UNIX_DynamicLibrary(const char *libname) : - _handle(nullptr), - _libname("") -{ - SetLibName(libname); -} - -FastOS_UNIX_DynamicLibrary::~FastOS_UNIX_DynamicLibrary() -{ - Close(); -} - -bool -FastOS_UNIX_DynamicLibrary::Open(const char *libname) -{ - if (! Close()) - return false; - if (libname != nullptr) { - SetLibName(libname); - } - - _handle = dlopen(_libname.c_str(), RTLD_NOW); - - if (_handle == nullptr) { - // Prepend "lib" if neccessary... - if (NormalizeLibName()) { - // ...try to open again if a change was made. - _handle = dlopen(_libname.c_str(), RTLD_NOW); - } - } - - return (_handle != nullptr); -} - -void * -FastOS_UNIX_DynamicLibrary::GetSymbol(const char *symbol) const -{ - return dlsym(_handle, symbol); -} - -std::string -FastOS_UNIX_DynamicLibrary::GetLastErrorString() const -{ - const char *errorString = dlerror(); - std::string e; - if (errorString != nullptr) { - e = errorString; - } - - return e; -} diff --git a/fastos/src/vespa/fastos/unix_dynamiclibrary.h b/fastos/src/vespa/fastos/unix_dynamiclibrary.h deleted file mode 100644 index 4d52a68f093..00000000000 --- a/fastos/src/vespa/fastos/unix_dynamiclibrary.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** -*************************************************************-*C++-*- -* @author Eyvind Bernhardsen -* @date Creation date: 2003-07-02 -* @file -* Class definitions for FastOS_Unix_DynamicLibrary -*********************************************************************/ - - - -#pragma once - - -#include <vespa/fastos/types.h> - -class FastOS_UNIX_DynamicLibrary : public FastOS_DynamicLibraryInterface -{ -private: - FastOS_UNIX_DynamicLibrary(const FastOS_UNIX_DynamicLibrary&); - FastOS_UNIX_DynamicLibrary& operator=(const FastOS_UNIX_DynamicLibrary&); - - void *_handle; - std::string _libname; - -public: - FastOS_UNIX_DynamicLibrary(const char *libname = nullptr); - ~FastOS_UNIX_DynamicLibrary(); - - void SetLibName(const char *libname); - bool NormalizeLibName(void); - bool Close() override; - bool Open(const char *libname = nullptr) override; - void * GetSymbol(const char *symbol) const override; - std::string GetLastErrorString() const; - const char * GetLibName() const { return _libname.c_str(); } - bool IsOpen() const override { return (_handle != nullptr); } -}; - - diff --git a/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp b/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp index c5c50ff596d..5c20c302b73 100644 --- a/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp +++ b/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp @@ -13,6 +13,7 @@ #include <cassert> #include <getopt.h> #include <vector> +#include <limits> #include <vespa/log/log.h> LOG_SETUP("vespa-gen-testdocs"); diff --git a/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h b/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h index 4aa8a3f6392..b133d5a5058 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h +++ b/searchcore/src/vespa/searchcore/proton/matching/docid_range_scheduler.h @@ -3,7 +3,7 @@ #pragma once #include <vespa/searchlib/queryeval/begin_and_end_id.h> -#include <vespa/fastos/dynamiclibrary.h> +#include <vespa/fastos/types.h> #include <mutex> #include <condition_variable> #include <atomic> diff --git a/searchlib/src/vespa/searchlib/aggregation/group.h b/searchlib/src/vespa/searchlib/aggregation/group.h index 202c5085133..53061b1447b 100644 --- a/searchlib/src/vespa/searchlib/aggregation/group.h +++ b/searchlib/src/vespa/searchlib/aggregation/group.h @@ -5,7 +5,6 @@ #include "aggregationresult.h" #include <vespa/searchlib/common/hitrank.h> #include <vespa/vespalib/stllike/hash_set.h> -#include <vespa/fastos/dynamiclibrary.h> #include <vector> namespace search::aggregation { diff --git a/searchlib/src/vespa/searchlib/common/bitvector.h b/searchlib/src/vespa/searchlib/common/bitvector.h index c1d447047d1..02f51fe8758 100644 --- a/searchlib/src/vespa/searchlib/common/bitvector.h +++ b/searchlib/src/vespa/searchlib/common/bitvector.h @@ -6,7 +6,7 @@ #include <memory> #include <vespa/vespalib/util/alloc.h> #include <vespa/vespalib/util/generationholder.h> -#include <vespa/fastos/dynamiclibrary.h> +#include <vespa/fastos/types.h> namespace vespalib { class nbostream; diff --git a/searchlib/src/vespa/searchlib/common/bitvectorcache.h b/searchlib/src/vespa/searchlib/common/bitvectorcache.h index 33610afc108..5f8edf29854 100644 --- a/searchlib/src/vespa/searchlib/common/bitvectorcache.h +++ b/searchlib/src/vespa/searchlib/common/bitvectorcache.h @@ -4,7 +4,6 @@ #include "condensedbitvectors.h" #include <vespa/vespalib/stllike/hash_set.h> #include <vespa/vespalib/stllike/hash_map.h> -#include <vespa/fastos/dynamiclibrary.h> #include <mutex> namespace search { diff --git a/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h b/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h index e91e06bdf7a..07467e28229 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h +++ b/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h @@ -5,7 +5,6 @@ #include <vespa/searchlib/index/postinglistfile.h> #include <vespa/searchlib/bitcompression/compression.h> #include <vespa/searchlib/queryeval/iterators.h> -#include <vespa/fastos/dynamiclibrary.h> namespace search::diskindex { diff --git a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h index d9375f12d54..1d5ac98a74d 100644 --- a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h +++ b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.h @@ -4,7 +4,6 @@ #include "nativerankfeature.h" #include "queryterm.h" -#include <vespa/fastos/dynamiclibrary.h> namespace search::features { diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_posting_list.h b/searchlib/src/vespa/searchlib/predicate/predicate_posting_list.h index 6ac41c62305..0bf33f1d0e5 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_posting_list.h +++ b/searchlib/src/vespa/searchlib/predicate/predicate_posting_list.h @@ -3,7 +3,7 @@ #include <memory> #include <cstdint> -#include <vespa/fastos/dynamiclibrary.h> +#include <vespa/fastos/types.h> /** * Interface for posting lists used by PredicateSearch. diff --git a/searchlib/src/vespa/searchlib/queryeval/andsearchnostrict.h b/searchlib/src/vespa/searchlib/queryeval/andsearchnostrict.h index 9707b02ae58..f809d9028c0 100644 --- a/searchlib/src/vespa/searchlib/queryeval/andsearchnostrict.h +++ b/searchlib/src/vespa/searchlib/queryeval/andsearchnostrict.h @@ -4,8 +4,7 @@ #include "andsearch.h" -namespace search { -namespace queryeval { +namespace search::queryeval { /** * A simple implementation of the And search operation. @@ -56,6 +55,4 @@ private: Unpack _unpacker; }; -} // namespace queryeval -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/queryeval/andsearchstrict.h b/searchlib/src/vespa/searchlib/queryeval/andsearchstrict.h index 63cbb77dbc8..96fb706f50c 100644 --- a/searchlib/src/vespa/searchlib/queryeval/andsearchstrict.h +++ b/searchlib/src/vespa/searchlib/queryeval/andsearchstrict.h @@ -3,10 +3,8 @@ #pragma once #include "andsearchnostrict.h" -#include <vespa/fastos/dynamiclibrary.h> -namespace search { -namespace queryeval { +namespace search::queryeval { /** * A simple strict implementation of the And search operation. @@ -105,6 +103,4 @@ AndSearchStrict<Unpack>::andWith(SearchIterator::UP filter, uint32_t estimate_) return filter; // Should always be empty, returning it incase logic changes. } -} // namespace queryeval -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/queryeval/booleanmatchiteratorwrapper.cpp b/searchlib/src/vespa/searchlib/queryeval/booleanmatchiteratorwrapper.cpp index f259bb3d242..8061160cb5e 100644 --- a/searchlib/src/vespa/searchlib/queryeval/booleanmatchiteratorwrapper.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/booleanmatchiteratorwrapper.cpp @@ -5,8 +5,7 @@ #include <vespa/searchlib/fef/termfieldmatchdataarray.h> #include <vespa/vespalib/objects/visit.hpp> -namespace search { -namespace queryeval { +namespace search::queryeval { void BooleanMatchIteratorWrapper::doSeek(uint32_t docid) @@ -41,5 +40,4 @@ BooleanMatchIteratorWrapper::visitMembers(vespalib::ObjectVisitor &visitor) cons // _match not visited } -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/elementiterator.h b/searchlib/src/vespa/searchlib/queryeval/elementiterator.h index 2f46baf087a..aff0fe29779 100644 --- a/searchlib/src/vespa/searchlib/queryeval/elementiterator.h +++ b/searchlib/src/vespa/searchlib/queryeval/elementiterator.h @@ -1,7 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/searchlib/queryeval/searchiterator.h> +#include "searchiterator.h" namespace search::fef { class TermFieldMatchData; } diff --git a/searchlib/src/vespa/searchlib/queryeval/emptysearch.h b/searchlib/src/vespa/searchlib/queryeval/emptysearch.h index dfb294c6e0c..897decb456b 100644 --- a/searchlib/src/vespa/searchlib/queryeval/emptysearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/emptysearch.h @@ -5,8 +5,7 @@ #include "searchiterator.h" #include <vespa/searchlib/common/bitvector.h> -namespace search { -namespace queryeval { +namespace search::queryeval { /** Search iterator that never yields any hits. */ class EmptySearch : public SearchIterator @@ -28,5 +27,4 @@ public: ~EmptySearch(); }; -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h index 126d395ddb2..706e05f0156 100644 --- a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h @@ -5,8 +5,7 @@ #include "blueprint.h" #include <vespa/searchlib/fef/matchdatalayout.h> -namespace search { -namespace queryeval { +namespace search::queryeval { class EquivBlueprint : public ComplexLeafBlueprint { @@ -32,5 +31,4 @@ public: bool isEquiv() const override { return true; } }; -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/fake_result.cpp b/searchlib/src/vespa/searchlib/queryeval/fake_result.cpp index 8b02dd1d6c9..47e53253210 100644 --- a/searchlib/src/vespa/searchlib/queryeval/fake_result.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/fake_result.cpp @@ -3,8 +3,7 @@ #include "fake_result.h" #include <ostream> -namespace search { -namespace queryeval { +namespace search::queryeval { FakeResult::FakeResult() : _documents(), @@ -46,5 +45,4 @@ std::ostream &operator << (std::ostream &out, const FakeResult &result) { return out; } -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/hitcollector.h b/searchlib/src/vespa/searchlib/queryeval/hitcollector.h index 85bbe5ee950..54a48e9ce49 100644 --- a/searchlib/src/vespa/searchlib/queryeval/hitcollector.h +++ b/searchlib/src/vespa/searchlib/queryeval/hitcollector.h @@ -3,13 +3,13 @@ #pragma once #include "scores.h" +#include "sorted_hit_sequence.h" #include <vespa/searchlib/common/hitrank.h> #include <vespa/searchlib/common/resultset.h> +#include <vespa/vespalib/util/sort.h> #include <algorithm> #include <vector> -#include <vespa/vespalib/util/sort.h> -#include <vespa/fastos/dynamiclibrary.h> -#include "sorted_hit_sequence.h" +#include <vespa/fastos/types.h> namespace search::queryeval { diff --git a/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.cpp b/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.cpp index efbc9d96cc6..a4a72807c0c 100644 --- a/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.cpp @@ -3,8 +3,7 @@ #include <vespa/log/log.h> LOG_SETUP(".queryeval.monitoring_dump_iterator"); -namespace search { -namespace queryeval { +namespace search::queryeval { MonitoringDumpIterator::MonitoringDumpIterator(MonitoringSearchIterator::UP iterator) : _search(std::move(iterator)) @@ -31,6 +30,4 @@ MonitoringDumpIterator::doUnpack(uint32_t docId) _search->unpack(docId); } -} // namespace queryeval -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.h b/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.h index 93229d74a39..7dbe04ac860 100644 --- a/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.h +++ b/searchlib/src/vespa/searchlib/queryeval/monitoring_dump_iterator.h @@ -3,8 +3,7 @@ #include "monitoring_search_iterator.h" -namespace search { -namespace queryeval { +namespace search::queryeval { /** * Search iterator that dumps the search stats of the underlying @@ -29,6 +28,4 @@ public: } }; -} // namespace queryeval -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.cpp b/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.cpp index d086d7b2ca5..cff62ea7117 100644 --- a/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.cpp @@ -8,8 +8,7 @@ LOG_SETUP(".queryeval.monitoring_search_iterator"); using vespalib::make_string; -namespace search { -namespace queryeval { +namespace search::queryeval { MonitoringSearchIterator::Stats::Stats() : _numSeeks(0), @@ -237,5 +236,4 @@ MonitoringSearchIterator::visitMembers(vespalib::ObjectVisitor &visitor) const _search->visitMembers(visitor); } -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h b/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h index 6345d203f9e..3d20b79a81d 100644 --- a/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h +++ b/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h @@ -5,8 +5,7 @@ #include <vespa/vespalib/objects/objectvisitor.h> #include <stack> -namespace search { -namespace queryeval { +namespace search::queryeval { /** * Search iterator that monitors an underlying search iterator @@ -122,6 +121,4 @@ public: const Stats &getStats() const { return _stats; } }; -} // namespace queryeval -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp b/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp index 2966ac06dcc..5297646d7f8 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp @@ -8,8 +8,7 @@ #include <vespa/log/log.h> LOG_SETUP(".nearsearch"); -namespace search { -namespace queryeval { +namespace search::queryeval { namespace { @@ -307,5 +306,4 @@ ONearSearch::match(uint32_t docId) return false; } -} // queryeval -} // search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/nearsearch.h b/searchlib/src/vespa/searchlib/queryeval/nearsearch.h index e2a93171001..bf3fded2717 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearsearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/nearsearch.h @@ -5,8 +5,7 @@ #include <vespa/searchlib/fef/termfieldmatchdataarray.h> #include "andsearch.h" -namespace search { -namespace queryeval { +namespace search::queryeval { /** * The near search base implements the common logic of the near and o-near search. @@ -145,6 +144,4 @@ public: }; -} // queryeval -} // search - +} diff --git a/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.cpp b/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.cpp index f6d20d88a6c..8357d403000 100644 --- a/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.cpp @@ -2,7 +2,6 @@ #include "sourceblendersearch.h" #include "isourceselector.h" -#include <vespa/fastos/dynamiclibrary.h> #include <vespa/vespalib/objects/visit.hpp> #include <vespa/vespalib/util/array.hpp> diff --git a/vespalib/src/vespa/vespalib/btree/btreeiterator.h b/vespalib/src/vespa/vespalib/btree/btreeiterator.h index e0df9744265..e44be0fb5e7 100644 --- a/vespalib/src/vespa/vespalib/btree/btreeiterator.h +++ b/vespalib/src/vespa/vespalib/btree/btreeiterator.h @@ -5,7 +5,6 @@ #include "btreenode.h" #include "btreenodeallocator.h" #include "btreetraits.h" -#include <vespa/fastos/dynamiclibrary.h> namespace vespalib::btree { diff --git a/vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp b/vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp index 2e6bccd1857..f5d87e14802 100644 --- a/vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp +++ b/vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp @@ -3,7 +3,7 @@ #pragma once #include "private_helpers.hpp" -#include <vespa/fastos/dynamiclibrary.h> +#include <vespa/fastos/types.h> namespace vespalib::hwaccelrated::avx { |