summaryrefslogtreecommitdiffstats
path: root/searchlib/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-10-06 14:05:38 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-10-06 14:58:28 +0200
commitcb60fccb0fb3bf92bf2a223324dad44e986ae54d (patch)
treebf3dc2a59ae2a4b501bbded96ce68fc56f2b2f4e /searchlib/src
parent3901ca812608d7c2fbcfdd7ca0524a8758a212ac (diff)
Let config reflect what it is, a threadpool serving a range of background task in the backend.
Diffstat (limited to 'searchlib/src')
-rw-r--r--searchlib/src/apps/docstore/benchmarkdatastore.cpp2
-rw-r--r--searchlib/src/apps/docstore/documentstoreinspect.cpp2
-rw-r--r--searchlib/src/apps/docstore/verifylogdatastore.cpp2
-rw-r--r--searchlib/src/apps/tests/biglogtest.cpp2
-rw-r--r--searchlib/src/tests/docstore/document_store/document_store_test.cpp2
-rw-r--r--searchlib/src/tests/docstore/document_store_visitor/document_store_visitor_test.cpp4
-rw-r--r--searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp49
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdatastore.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdatastore.h3
9 files changed, 28 insertions, 40 deletions
diff --git a/searchlib/src/apps/docstore/benchmarkdatastore.cpp b/searchlib/src/apps/docstore/benchmarkdatastore.cpp
index 3dcfbbb31cc..620a139d451 100644
--- a/searchlib/src/apps/docstore/benchmarkdatastore.cpp
+++ b/searchlib/src/apps/docstore/benchmarkdatastore.cpp
@@ -99,7 +99,7 @@ BenchmarkDataStoreApp::benchmark(const vespalib::string & dir, size_t numReads,
tuning._randRead.setWantMemoryMap();
}
search::index::DummyFileHeaderContext fileHeaderContext;
- vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024);
+ vespalib::ThreadStackExecutor executor(1, 128*1024);
transactionlog::NoSyncProxy noTlSyncer;
LogDataStore store(executor, dir, config, growStrategy, tuning,
fileHeaderContext,
diff --git a/searchlib/src/apps/docstore/documentstoreinspect.cpp b/searchlib/src/apps/docstore/documentstoreinspect.cpp
index b7f202f1209..40f603c3da1 100644
--- a/searchlib/src/apps/docstore/documentstoreinspect.cpp
+++ b/searchlib/src/apps/docstore/documentstoreinspect.cpp
@@ -105,7 +105,7 @@ DocumentStoreInspectApp::verify(const vespalib::string & dir)
GrowStrategy growStrategy;
TuneFileSummary tuning;
search::index::DummyFileHeaderContext fileHeaderContext;
- vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024);
+ vespalib::ThreadStackExecutor executor(1, 128*1024);
transactionlog::NoSyncProxy noTlSyncer;
LogDataStore store(executor, dir, config, growStrategy, tuning,
diff --git a/searchlib/src/apps/docstore/verifylogdatastore.cpp b/searchlib/src/apps/docstore/verifylogdatastore.cpp
index 1fb83248b5b..498516882c1 100644
--- a/searchlib/src/apps/docstore/verifylogdatastore.cpp
+++ b/searchlib/src/apps/docstore/verifylogdatastore.cpp
@@ -49,7 +49,7 @@ VerifyLogDataStoreApp::verify(const vespalib::string & dir)
GrowStrategy growStrategy;
TuneFileSummary tuning;
search::index::DummyFileHeaderContext fileHeaderContext;
- vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024);
+ vespalib::ThreadStackExecutor executor(1, 128*1024);
transactionlog::NoSyncProxy noTlSyncer;
try {
diff --git a/searchlib/src/apps/tests/biglogtest.cpp b/searchlib/src/apps/tests/biglogtest.cpp
index b5eb76d40a7..788fb855c7f 100644
--- a/searchlib/src/apps/tests/biglogtest.cpp
+++ b/searchlib/src/apps/tests/biglogtest.cpp
@@ -134,7 +134,7 @@ factory<LogDataStore>::factory(std::string dir)
: DioTune(),
_fileHeaderContext(),
_config(),
- _executor(_config.getNumThreads(), 128*1024),
+ _executor(1, 128*1024),
_noTlSyncer(),
_datastore(_executor, dir, _config, GrowStrategy(), tuning, _fileHeaderContext, _noTlSyncer, NULL)
{}
diff --git a/searchlib/src/tests/docstore/document_store/document_store_test.cpp b/searchlib/src/tests/docstore/document_store/document_store_test.cpp
index b48d754bfb5..2ab24a00557 100644
--- a/searchlib/src/tests/docstore/document_store/document_store_test.cpp
+++ b/searchlib/src/tests/docstore/document_store/document_store_test.cpp
@@ -77,7 +77,7 @@ TEST("require that LogDocumentStore::Config equality operator detects inequality
EXPECT_TRUE(C() == C());
EXPECT_FALSE(C() != C());
EXPECT_FALSE(C(DC(CompressionConfig::NONE, 100000, 100), LC()) == C());
- EXPECT_FALSE(C(DC(), LC().setNumThreads(7)) == C());
+ EXPECT_FALSE(C(DC(), LC().setMaxBucketSpread(7)) == C());
}
TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchlib/src/tests/docstore/document_store_visitor/document_store_visitor_test.cpp b/searchlib/src/tests/docstore/document_store_visitor/document_store_visitor_test.cpp
index 7e4b4fa4363..247ee134854 100644
--- a/searchlib/src/tests/docstore/document_store_visitor/document_store_visitor_test.cpp
+++ b/searchlib/src/tests/docstore/document_store_visitor/document_store_visitor_test.cpp
@@ -234,9 +234,9 @@ Fixture::Fixture()
: _baseDir("visitor"),
_repo(makeDocTypeRepoConfig()),
_storeConfig(DocumentStore::Config(CompressionConfig::NONE, 0, 0),
- LogDataStore::Config().setMaxFileSize(50000).setMaxBucketSpread(3.0).setNumThreads(1)
+ LogDataStore::Config().setMaxFileSize(50000).setMaxBucketSpread(3.0)
.setFileConfig(WriteableFileChunk::Config(CompressionConfig(), 16384))),
- _executor(_storeConfig.getLogConfig().getNumThreads(), 128 * 1024),
+ _executor(1, 128 * 1024),
_fileHeaderContext(),
_tlSyncer(),
_store(),
diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
index c7da0c17c80..ed99003c2f7 100644
--- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
+++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
@@ -205,9 +205,9 @@ TEST("testGrowing") {
LogDataStore::Config config; //(100000, 0.1, 3.0, 0.2, 8, true, CompressionConfig::LZ4,
// WriteableFileChunk::Config(CompressionConfig(CompressionConfig::LZ4, 9, 60), 1000));
config.setMaxFileSize(100000).setMaxDiskBloatFactor(0.1).setMaxBucketSpread(3.0).setMinFileSizeFactor(0.2)
- .setNumThreads(8).compact2ActiveFile(true).compactCompression({CompressionConfig::LZ4})
+ .compact2ActiveFile(true).compactCompression({CompressionConfig::LZ4})
.setFileConfig({{CompressionConfig::LZ4, 9, 60}, 1000});
- vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024);
+ vespalib::ThreadStackExecutor executor(8, 128*1024);
DummyFileHeaderContext fileHeaderContext;
MyTlSyncer tlSyncer;
{
@@ -276,30 +276,26 @@ void fetchAndTest(IDataStore & datastore, uint32_t lid, const void *a, size_t sz
TEST("testTruncatedIdxFile"){
LogDataStore::Config config;
DummyFileHeaderContext fileHeaderContext;
- vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024);
+ vespalib::ThreadStackExecutor executor(1, 128*1024);
MyTlSyncer tlSyncer;
{
// Files comes from the 'growing test'.
- LogDataStore datastore(executor,
- TEST_PATH("bug-7257706"), config,
- GrowStrategy(), TuneFileSummary(),
- fileHeaderContext, tlSyncer, NULL);
+ LogDataStore datastore(executor, TEST_PATH("bug-7257706"), config, GrowStrategy(),
+ TuneFileSummary(), fileHeaderContext, tlSyncer, NULL);
EXPECT_EQUAL(354ul, datastore.lastSyncToken());
}
const char * magic = "mumbo jumbo";
{
- LogDataStore datastore(executor, "bug-7257706-truncated", config,
- GrowStrategy(), TuneFileSummary(),
- fileHeaderContext, tlSyncer, NULL);
+ LogDataStore datastore(executor, "bug-7257706-truncated", config, GrowStrategy(),
+ TuneFileSummary(), fileHeaderContext, tlSyncer, NULL);
EXPECT_EQUAL(331ul, datastore.lastSyncToken());
datastore.write(332, 7, magic, strlen(magic));
datastore.write(333, 8, magic, strlen(magic));
datastore.flush(datastore.initFlush(334));
}
{
- LogDataStore datastore(executor, "bug-7257706-truncated", config,
- GrowStrategy(), TuneFileSummary(),
- fileHeaderContext, tlSyncer, NULL);
+ LogDataStore datastore(executor, "bug-7257706-truncated", config, GrowStrategy(),
+ TuneFileSummary(), fileHeaderContext, tlSyncer, NULL);
EXPECT_EQUAL(334ul, datastore.lastSyncToken());
}
}
@@ -307,7 +303,7 @@ TEST("testTruncatedIdxFile"){
TEST("testThatEmptyIdxFilesAndDanglingDatFilesAreRemoved") {
LogDataStore::Config config;
DummyFileHeaderContext fileHeaderContext;
- vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024);
+ vespalib::ThreadStackExecutor executor(1, 128*1024);
MyTlSyncer tlSyncer;
LogDataStore datastore(executor, "dangling-test", config,
GrowStrategy(), TuneFileSummary(),
@@ -320,7 +316,7 @@ TEST("testThatEmptyIdxFilesAndDanglingDatFilesAreRemoved") {
TEST("testThatIncompleteCompactedFilesAreRemoved") {
LogDataStore::Config config;
DummyFileHeaderContext fileHeaderContext;
- vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024);
+ vespalib::ThreadStackExecutor executor(1, 128*1024);
MyTlSyncer tlSyncer;
LogDataStore datastore(executor, "incompletecompact-test", config,
GrowStrategy(), TuneFileSummary(),
@@ -340,11 +336,10 @@ public:
_myDir("visitcache"),
_config(),
_fileHeaderContext(),
- _executor(_config.getNumThreads(), 128*1024),
+ _executor(1, 128*1024),
_tlSyncer(),
- _datastore(_executor, _myDir.getDir(), _config,
- GrowStrategy(), TuneFileSummary(),
- _fileHeaderContext, _tlSyncer, NULL)
+ _datastore(_executor, _myDir.getDir(), _config, GrowStrategy(),
+ TuneFileSummary(), _fileHeaderContext, _tlSyncer, NULL)
{ }
~VisitStore();
IDataStore & getStore() { return _datastore; }
@@ -518,10 +513,10 @@ VisitCacheStore::VisitCacheStore() :
_myDir("visitcache"),
_repo(makeDocTypeRepoConfig()),
_config(DocumentStore::Config(CompressionConfig::LZ4, 1000000, 0).allowVisitCaching(true),
- LogDataStore::Config().setMaxFileSize(50000).setMaxBucketSpread(3.0).setNumThreads(1)
+ LogDataStore::Config().setMaxFileSize(50000).setMaxBucketSpread(3.0)
.setFileConfig(WriteableFileChunk::Config(CompressionConfig(), 16384))),
_fileHeaderContext(),
- _executor(_config.getLogConfig().getNumThreads(), 128*1024),
+ _executor(1, 128*1024),
_tlSyncer(),
_datastore(_executor, _myDir.getDir(), _config, GrowStrategy(),
TuneFileSummary(), _fileHeaderContext, _tlSyncer, nullptr),
@@ -596,11 +591,10 @@ TEST("testWriteRead") {
{
EXPECT_TRUE(FastOS_File::MakeDirectory("empty"));
DummyFileHeaderContext fileHeaderContext;
- vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024);
+ vespalib::ThreadStackExecutor executor(1, 128*1024);
MyTlSyncer tlSyncer;
- LogDataStore datastore(executor, "empty", config,
- GrowStrategy(), TuneFileSummary(),
- fileHeaderContext, tlSyncer, NULL);
+ LogDataStore datastore(executor, "empty", config, GrowStrategy(),
+ TuneFileSummary(), fileHeaderContext, tlSyncer, NULL);
ASSERT_TRUE(datastore.lastSyncToken() == 0);
size_t headerFootprint = datastore.getDiskHeaderFootprint();
EXPECT_LESS(0u, headerFootprint);
@@ -633,7 +627,7 @@ TEST("testWriteRead") {
}
{
DummyFileHeaderContext fileHeaderContext;
- vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024);
+ vespalib::ThreadStackExecutor executor(1, 128*1024);
MyTlSyncer tlSyncer;
LogDataStore datastore(executor, "empty", config,
GrowStrategy(), TuneFileSummary(),
@@ -684,7 +678,7 @@ TEST("requireThatFlushTimeIsAvailableAfterFlush") {
fastos::TimeStamp before(fastos::ClockSystem::now());
DummyFileHeaderContext fileHeaderContext;
LogDataStore::Config config;
- vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024);
+ vespalib::ThreadStackExecutor executor(1, 128*1024);
MyTlSyncer tlSyncer;
LogDataStore store(executor, testDir.getDir(), config, GrowStrategy(),
TuneFileSummary(), fileHeaderContext, tlSyncer, nullptr);
@@ -980,7 +974,6 @@ TEST("require that config equality operator detects inequality") {
EXPECT_FALSE(C() == C().setMaxDiskBloatFactor(0.3));
EXPECT_FALSE(C() == C().setMaxBucketSpread(0.3));
EXPECT_FALSE(C() == C().setMinFileSizeFactor(0.3));
- EXPECT_FALSE(C() == C().setNumThreads(3));
EXPECT_FALSE(C() == C().setFileConfig(WriteableFileChunk::Config({}, 70)));
EXPECT_FALSE(C() == C().disableCrcOnRead(true));
EXPECT_FALSE(C() == C().compact2ActiveFile(false));
diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
index 6c2509c53c5..4e3178fcdb1 100644
--- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
@@ -34,7 +34,6 @@ LogDataStore::Config::Config()
_maxDiskBloatFactor(0.2),
_maxBucketSpread(2.5),
_minFileSizeFactor(0.2),
- _numThreads(8),
_skipCrcOnRead(false),
_compact2ActiveFile(true),
_compactCompression(CompressionConfig::LZ4),
@@ -49,7 +48,6 @@ LogDataStore::Config::operator == (const Config & rhs) const {
(_minFileSizeFactor == rhs._minFileSizeFactor) &&
(_compact2ActiveFile == rhs._compact2ActiveFile) &&
(_skipCrcOnRead == rhs._skipCrcOnRead) &&
- (_numThreads == rhs._numThreads) &&
(_compactCompression == rhs._compactCompression) &&
(_fileConfig == rhs._fileConfig);
}
diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.h b/searchlib/src/vespa/searchlib/docstore/logdatastore.h
index 5928602e196..52d78cac2bd 100644
--- a/searchlib/src/vespa/searchlib/docstore/logdatastore.h
+++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.h
@@ -43,7 +43,6 @@ public:
Config & setMaxBucketSpread(double v) { _maxBucketSpread = v; return *this; }
Config & setMinFileSizeFactor(double v) { _minFileSizeFactor = v; return *this; }
- Config & setNumThreads(size_t v) { _numThreads = v; return *this; }
Config & compactCompression(CompressionConfig v) { _compactCompression = v; return *this; }
Config & setFileConfig(WriteableFileChunk::Config v) { _fileConfig = v; return *this; }
@@ -52,7 +51,6 @@ public:
double getMaxBucketSpread() const { return _maxBucketSpread; }
double getMinFileSizeFactor() const { return _minFileSizeFactor; }
- size_t getNumThreads() const { return _numThreads; }
bool crcOnReadDisabled() const { return _skipCrcOnRead; }
bool compact2ActiveFile() const { return _compact2ActiveFile; }
const CompressionConfig & compactCompression() const { return _compactCompression; }
@@ -67,7 +65,6 @@ public:
double _maxDiskBloatFactor;
double _maxBucketSpread;
double _minFileSizeFactor;
- size_t _numThreads;
bool _skipCrcOnRead;
bool _compact2ActiveFile;
CompressionConfig _compactCompression;