Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 947796
Collapse All | Expand All

(-)a/cmake/cotire.cmake (-1 / +1 lines)
Lines 39-45 if (NOT CMAKE_SCRIPT_MODE_FILE) Link Here
39
endif()
39
endif()
40
# we need the CMake variables CMAKE_SCRIPT_MODE_FILE and CMAKE_ARGV available since 2.8.5
40
# we need the CMake variables CMAKE_SCRIPT_MODE_FILE and CMAKE_ARGV available since 2.8.5
41
# we need APPEND_STRING option for set_property available since 2.8.6
41
# we need APPEND_STRING option for set_property available since 2.8.6
42
cmake_minimum_required(VERSION 2.8.6)
42
cmake_minimum_required(VERSION 3.10)
43
if (NOT CMAKE_SCRIPT_MODE_FILE)
43
if (NOT CMAKE_SCRIPT_MODE_FILE)
44
	cmake_policy(POP)
44
	cmake_policy(POP)
45
endif()
45
endif()
(-)a/include/ThreadPool.h (-5 / +3 lines)
Lines 14-20 Link Here
14
14
15
namespace Lucene {
15
namespace Lucene {
16
16
17
typedef boost::shared_ptr<boost::asio::io_service::work> workPtr;
17
typedef boost::asio::executor_work_guard<boost::asio::io_context::executor_type> workPtr;
18
18
19
/// A Future represents the result of an asynchronous computation. Methods are provided to check if the computation
19
/// A Future represents the result of an asynchronous computation. Methods are provided to check if the computation
20
/// is complete, to wait for its completion, and to retrieve the result of the computation. The result can only be
20
/// is complete, to wait for its completion, and to retrieve the result of the computation. The result can only be
Lines 51-59 public: Link Here
51
    LUCENE_CLASS(ThreadPool);
51
    LUCENE_CLASS(ThreadPool);
52
52
53
protected:
53
protected:
54
    boost::asio::io_service io_service;
54
    boost::asio::thread_pool io_service;
55
    workPtr work;
56
    boost::thread_group threadGroup;
57
55
58
    static const int32_t THREADPOOL_SIZE;
56
    static const int32_t THREADPOOL_SIZE;
59
57
Lines 64-70 public: Link Here
64
    template <typename FUNC>
62
    template <typename FUNC>
65
    FuturePtr scheduleTask(FUNC func) {
63
    FuturePtr scheduleTask(FUNC func) {
66
        FuturePtr future(newInstance<Future>());
64
        FuturePtr future(newInstance<Future>());
67
        io_service.post(boost::bind(&ThreadPool::execute<FUNC>, this, func, future));
65
        boost::asio::post(io_service, boost::bind(&ThreadPool::execute<FUNC>, this, func, future));
68
        return future;
66
        return future;
69
    }
67
    }
70
68
(-)a/include/VariantUtils.h (-2 / +33 lines)
Lines 43-50 public: Link Here
43
        return typeOf<VariantNull>(var);
43
        return typeOf<VariantNull>(var);
44
    }
44
    }
45
45
46
    template <typename VAR>
46
    static int32_t hashCode(String var) {
47
    static int32_t hashCode(VAR var) {
47
        return StringUtils::hashCode(var);
48
    }
49
50
    static int32_t hashCode(int32_t var) {
51
        return var;
52
    }
53
54
    static int32_t hashCode(int64_t var) {
55
        return var;
56
    }
57
    static int32_t hashCode(double var) {
58
        int64_t longBits = MiscUtils::doubleToLongBits(var);
59
        return (int32_t)(longBits ^ (longBits >> 32));
60
    }
61
62
    static int32_t hashCode(NumericValue var) {
63
        return boost::apply_visitor([](auto _var){
64
            return hashCode(_var);
65
        },var);
66
    }
67
68
69
    template<typename T>
70
    static int32_t hashCode(Collection<T> var) {
71
        return var.hashCode();
72
    }
73
74
    static int32_t hashCode(LuceneObjectPtr var) {
75
            return var->hashCode();
76
    }
77
78
    static int32_t hashCodeAny(boost::any var) {
48
        if (typeOf<String>(var)) {
79
        if (typeOf<String>(var)) {
49
            return StringUtils::hashCode(get<String>(var));
80
            return StringUtils::hashCode(get<String>(var));
50
        }
81
        }
(-)a/src/core/document/NumericField.cpp (-1 / +9 lines)
Lines 11-16 Link Here
11
#include "NumericTokenStream.h"
11
#include "NumericTokenStream.h"
12
#include "StringUtils.h"
12
#include "StringUtils.h"
13
13
14
inline std::wostream& operator << (std::wostream& s, const boost::shared_ptr<Lucene::Reader>& reader)
15
{
16
    s << reader.get();
17
    return s;
18
}
19
14
namespace Lucene {
20
namespace Lucene {
15
21
16
NumericField::NumericField(const String& name)
22
NumericField::NumericField(const String& name)
Lines 54-60 ReaderPtr NumericField::readerValue() { Link Here
54
60
55
String NumericField::stringValue() {
61
String NumericField::stringValue() {
56
    StringStream value;
62
    StringStream value;
57
    value << fieldsData;
63
    boost::apply_visitor([&](auto V){
64
        value << V;
65
    }, fieldsData);
58
    return value.str();
66
    return value.str();
59
}
67
}
60
68
(-)a/src/core/search/FieldCacheImpl.cpp (-1 / +1 lines)
Lines 131-137 bool Entry::equals(const LuceneObjectPtr& other) { Link Here
131
}
131
}
132
132
133
int32_t Entry::hashCode() {
133
int32_t Entry::hashCode() {
134
    return StringUtils::hashCode(field) ^ VariantUtils::hashCode(custom);
134
    return StringUtils::hashCode(field) ^ VariantUtils::hashCodeAny(custom);
135
}
135
}
136
136
137
Cache::Cache(const FieldCachePtr& wrapper) {
137
Cache::Cache(const FieldCachePtr& wrapper) {
(-)a/src/core/store/MMapDirectory.cpp (-1 / +1 lines)
Lines 36-42 MMapIndexInput::MMapIndexInput(const String& path) { Link Here
36
    bufferPosition = 0;
36
    bufferPosition = 0;
37
    if (!path.empty()) {
37
    if (!path.empty()) {
38
        try {
38
        try {
39
            file.open(boost::filesystem::wpath(path), _length);
39
            file.open(boost::filesystem::path(path), _length);
40
        } catch (...) {
40
        } catch (...) {
41
            boost::throw_exception(FileNotFoundException(path));
41
            boost::throw_exception(FileNotFoundException(path));
42
        }
42
        }
(-)a/src/core/util/FieldCacheSanityChecker.cpp (-1 / +1 lines)
Lines 53-59 Collection<InsanityPtr> FieldCacheSanityChecker::check(Collection<FieldCacheEntr Link Here
53
        }
53
        }
54
54
55
        ReaderFieldPtr rf(newLucene<ReaderField>(item->getReaderKey(), item->getFieldName()));
55
        ReaderFieldPtr rf(newLucene<ReaderField>(item->getReaderKey(), item->getFieldName()));
56
        int32_t valId = VariantUtils::hashCode(val);
56
        int32_t valId = VariantUtils::hashCodeAny(val);
57
57
58
        // indirect mapping, so the MapOfSet will dedup identical valIds for us
58
        // indirect mapping, so the MapOfSet will dedup identical valIds for us
59
        valIdToItems.put(valId, item);
59
        valIdToItems.put(valId, item);
(-)a/src/core/util/FileUtils.cpp (-5 / +3 lines)
Lines 5-13 Link Here
5
/////////////////////////////////////////////////////////////////////////////
5
/////////////////////////////////////////////////////////////////////////////
6
6
7
#include "LuceneInc.h"
7
#include "LuceneInc.h"
8
#include <boost/filesystem/convenience.hpp>
8
#include <boost/filesystem.hpp>
9
#include <boost/filesystem/operations.hpp>
10
#include <boost/filesystem/path.hpp>
11
#include "LuceneThread.h"
9
#include "LuceneThread.h"
12
#include "StringUtils.h"
10
#include "StringUtils.h"
13
#include "FileUtils.h"
11
#include "FileUtils.h"
Lines 128-139 String joinPath(const String& path, const String& file) { Link Here
128
}
126
}
129
127
130
String extractPath(const String& path) {
128
String extractPath(const String& path) {
131
    boost::filesystem::wpath parentPath(path.c_str());
129
    boost::filesystem::path parentPath(path.c_str());
132
    return parentPath.parent_path().wstring().c_str();
130
    return parentPath.parent_path().wstring().c_str();
133
}
131
}
134
132
135
String extractFile(const String& path) {
133
String extractFile(const String& path) {
136
    boost::filesystem::wpath fileName(path.c_str());
134
    boost::filesystem::path fileName(path.c_str());
137
    return fileName.filename().wstring().c_str();
135
    return fileName.filename().wstring().c_str();
138
}
136
}
139
137
(-)a/src/core/util/ThreadPool.cpp (-7 / +3 lines)
Lines 14-29 Future::~Future() { Link Here
14
14
15
const int32_t ThreadPool::THREADPOOL_SIZE = 5;
15
const int32_t ThreadPool::THREADPOOL_SIZE = 5;
16
16
17
ThreadPool::ThreadPool() {
17
ThreadPool::ThreadPool()
18
    work.reset(new boost::asio::io_service::work(io_service));
18
    : io_service(THREADPOOL_SIZE)
19
    for (int32_t i = 0; i < THREADPOOL_SIZE; ++i) {
19
{
20
        threadGroup.create_thread(boost::bind(&boost::asio::io_service::run, &io_service));
21
    }
22
}
20
}
23
21
24
ThreadPool::~ThreadPool() {
22
ThreadPool::~ThreadPool() {
25
    work.reset(); // stop all threads
26
    threadGroup.join_all(); // wait for all competition
27
}
23
}
28
24
29
ThreadPoolPtr ThreadPool::getInstance() {
25
ThreadPoolPtr ThreadPool::getInstance() {
(-)a/src/test/search/QueryUtils.cpp (-2 / +1 lines)
Lines 251-257 public: Link Here
251
                    << (scorerDiff > maxDiff ? L"--> " : L"") << L"scorerScore2="
251
                    << (scorerDiff > maxDiff ? L"--> " : L"") << L"scorerScore2="
252
                    << scorerScore2 << L" scorerDiff=" << scorerDiff
252
                    << scorerScore2 << L" scorerDiff=" << scorerDiff
253
                    << L"\n\thitCollector.doc=" << doc << L" score="
253
                    << L"\n\thitCollector.doc=" << doc << L" score="
254
                    << score << L"\n\t Scorer=" << scorer << L"\n\t Query="
254
                    << score << L"\n\t Scorer=" << scorer.get() << L"\n\t Query="
255
                    << q->toString() + L"  " << L"\n\t Searcher=" + s->toString()
255
                    << q->toString() + L"  " << L"\n\t Searcher=" + s->toString()
256
                    << L"\n\t Order=" << sbord.str() << L"\n\t Op="
256
                    << L"\n\t Order=" << sbord.str() << L"\n\t Op="
257
                    << (op == skip_op ? L" skip()" : L" next()");
257
                    << (op == skip_op ? L" skip()" : L" next()");
258
- 

Return to bug 947796