summaryrefslogtreecommitdiffstats
path: root/memfilepersistence
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-04-25 23:34:41 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-04-26 16:08:04 +0200
commit76380b32f48f98711151220227331552693289c1 (patch)
treed10fc37a94bb7746cb074e29f057a489360dfc92 /memfilepersistence
parent2a3440e6ee544569c8fae7a03fa70195f0963477 (diff)
Optimize includes and add override.
Diffstat (limited to 'memfilepersistence')
-rw-r--r--memfilepersistence/src/tests/conformance/memfileconformancetest.cpp3
-rw-r--r--memfilepersistence/src/tests/device/devicemanagertest.cpp14
-rw-r--r--memfilepersistence/src/tests/device/devicemappertest.cpp2
-rw-r--r--memfilepersistence/src/tests/device/devicestest.cpp2
-rw-r--r--memfilepersistence/src/tests/device/mountpointlisttest.cpp4
-rw-r--r--memfilepersistence/src/tests/device/partitionmonitortest.cpp3
-rw-r--r--memfilepersistence/src/tests/helper/testhelper.cpp5
-rw-r--r--memfilepersistence/src/tests/init/filescannertest.cpp5
-rw-r--r--memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp10
-rw-r--r--memfilepersistence/src/tests/spi/buffer_test.cpp2
-rw-r--r--memfilepersistence/src/tests/spi/buffered_file_writer_test.cpp2
-rw-r--r--memfilepersistence/src/tests/spi/iteratorhandlertest.cpp5
-rw-r--r--memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp5
-rw-r--r--memfilepersistence/src/tests/spi/memcachetest.cpp2
-rw-r--r--memfilepersistence/src/tests/spi/memfileautorepairtest.cpp4
-rw-r--r--memfilepersistence/src/tests/spi/memfiletestutils.h4
-rw-r--r--memfilepersistence/src/tests/spi/memfilev1serializertest.cpp18
-rw-r--r--memfilepersistence/src/tests/spi/memfilev1verifiertest.cpp5
-rw-r--r--memfilepersistence/src/tests/spi/providerconformancetest.cpp13
-rw-r--r--memfilepersistence/src/tests/spi/shared_data_location_tracker_test.cpp2
-rw-r--r--memfilepersistence/src/tests/spi/simplememfileiobuffertest.cpp19
-rw-r--r--memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp5
-rw-r--r--memfilepersistence/src/tests/testrunner.cpp6
-rw-r--r--memfilepersistence/src/tests/tools/vdsdisktooltest.cpp1
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/config_aliases.h3
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/config_lock_guard.cpp6
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/config_lock_guard.h5
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/environment.h13
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/exceptions.cpp3
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/exceptions.h2
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/filespecification.h8
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/options.h7
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/slotmatcher.cpp4
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/types.h6
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/device.cpp19
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/device.h5
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/devicemanager.cpp4
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/devicemanager.h28
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/devicemapper.cpp8
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/devicemapper.h19
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/directory.cpp7
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/directory.h9
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/disk.cpp8
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/disk.h10
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/ioevent.cpp13
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/ioevent.h6
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/mountpointlist.cpp19
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/mountpointlist.h14
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/partition.cpp8
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/partition.h13
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.cpp3
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.h12
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/bucketdirectorymapper.cpp4
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/bucketdirectorymapper.h2
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/buffer.cpp6
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/bufferedfilewriter.cpp5
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/locationreadplanner.cpp3
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/memfile_v1_serializer.cpp16
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/memfile_v1_serializer.h46
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/memfilemapper.cpp10
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/memfilemapper.h2
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.h71
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/slotreadplanner.cpp4
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/uniqueslotgenerator.cpp6
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/versionserializer.h7
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.h6
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/memfilecache.cpp20
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/memfileptr.h2
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.cpp3
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/shared_data_location_tracker.cpp5
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/slotiterator.h9
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/cacheevictionguard.cpp6
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/cacheevictionguard.h1
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/iteratorhandler.cpp44
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/iteratorhandler.h26
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/joinoperationhandler.cpp8
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/memfilepersistence.cpp3
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/operationhandler.h6
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/splitoperationhandler.cpp12
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/threadlocals.cpp4
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/threadlocals.h1
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/visitorslotmatcher.cpp6
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/spi/visitorslotmatcher.h3
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfile.cpp3
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfileapp.cpp4
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/tools/vdsdiskapp.cpp7
86 files changed, 290 insertions, 474 deletions
diff --git a/memfilepersistence/src/tests/conformance/memfileconformancetest.cpp b/memfilepersistence/src/tests/conformance/memfileconformancetest.cpp
index 18a12788945..a2dad15de5a 100644
--- a/memfilepersistence/src/tests/conformance/memfileconformancetest.cpp
+++ b/memfilepersistence/src/tests/conformance/memfileconformancetest.cpp
@@ -1,10 +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>
#include <vespa/memfilepersistence/spi/memfilepersistence.h>
#include <vespa/persistence/conformancetest/conformancetest.h>
+#include <vespa/log/log.h>
LOG_SETUP(".test.conformance");
using namespace storage::spi;
diff --git a/memfilepersistence/src/tests/device/devicemanagertest.cpp b/memfilepersistence/src/tests/device/devicemanagertest.cpp
index 15882663383..f5e16032361 100644
--- a/memfilepersistence/src/tests/device/devicemanagertest.cpp
+++ b/memfilepersistence/src/tests/device/devicemanagertest.cpp
@@ -1,10 +1,8 @@
// 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/memfilepersistence/device/devicemanager.h>
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/util/exception.h>
-#include <sys/errno.h>
#include <vespa/storageframework/defaultimplementation/clock/fakeclock.h>
namespace storage {
@@ -70,19 +68,17 @@ namespace {
std::ostringstream ost;
Listener() : ost() { ost << "\n"; }
- virtual ~Listener() {}
+ ~Listener() {}
- virtual void handleDirectoryEvent(Directory& dir, const IOEvent& e) override {
+ void handleDirectoryEvent(Directory& dir, const IOEvent& e) override {
ost << "Dir " << dir.getPath() << ": " << e.toString(true) << "\n";
}
- virtual void handlePartitionEvent(Partition& part, const IOEvent& e) override {
- ost << "Partition " << part.getMountPoint() << ": "
- << e.toString(true) << "\n";
+ void handlePartitionEvent(Partition& part, const IOEvent& e) override {
+ ost << "Partition " << part.getMountPoint() << ": " << e.toString(true) << "\n";
}
- virtual void handleDiskEvent(Disk& disk, const IOEvent& e) override {
+ void handleDiskEvent(Disk& disk, const IOEvent& e) override {
ost << "Disk " << disk.getId() << ": " << e.toString(true) << "\n";
}
-
};
}
diff --git a/memfilepersistence/src/tests/device/devicemappertest.cpp b/memfilepersistence/src/tests/device/devicemappertest.cpp
index a78554a6342..c1d0cbd706c 100644
--- a/memfilepersistence/src/tests/device/devicemappertest.cpp
+++ b/memfilepersistence/src/tests/device/devicemappertest.cpp
@@ -1,10 +1,8 @@
// 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/memfilepersistence/device/devicemapper.h>
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/util/exceptions.h>
-#include <sys/errno.h>
namespace storage {
diff --git a/memfilepersistence/src/tests/device/devicestest.cpp b/memfilepersistence/src/tests/device/devicestest.cpp
index 8bcc93e5fc9..67ed747b5b5 100644
--- a/memfilepersistence/src/tests/device/devicestest.cpp
+++ b/memfilepersistence/src/tests/device/devicestest.cpp
@@ -1,10 +1,8 @@
// 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/memfilepersistence/device/devicemanager.h>
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/util/exceptions.h>
-#include <sys/errno.h>
#include <vespa/storageframework/defaultimplementation/clock/fakeclock.h>
namespace storage {
diff --git a/memfilepersistence/src/tests/device/mountpointlisttest.cpp b/memfilepersistence/src/tests/device/mountpointlisttest.cpp
index 986b6fbe157..3cc72f43665 100644
--- a/memfilepersistence/src/tests/device/mountpointlisttest.cpp
+++ b/memfilepersistence/src/tests/device/mountpointlisttest.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 <vespa/vdstestlib/cppunit/macros.h>
-#include <fstream>
#include <vespa/memfilepersistence/device/mountpointlist.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/storageframework/defaultimplementation/clock/fakeclock.h>
+#include <vespa/vdstestlib/cppunit/macros.h>
using vespalib::fileExists;
using vespalib::isDirectory;
diff --git a/memfilepersistence/src/tests/device/partitionmonitortest.cpp b/memfilepersistence/src/tests/device/partitionmonitortest.cpp
index 44f3752d840..d1f40e07320 100644
--- a/memfilepersistence/src/tests/device/partitionmonitortest.cpp
+++ b/memfilepersistence/src/tests/device/partitionmonitortest.cpp
@@ -1,6 +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/memfilepersistence/device/partitionmonitor.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vdstestlib/cppunit/macros.h>
@@ -56,7 +55,7 @@ struct FakeStatter : public PartitionMonitor::Statter {
_info.f_bfree -= (size / _info.f_bsize);
}
- virtual void statFileSystem(const std::string&, struct statvfs& info) override {
+ void statFileSystem(const std::string&, struct statvfs& info) override {
info = _info;
}
};
diff --git a/memfilepersistence/src/tests/helper/testhelper.cpp b/memfilepersistence/src/tests/helper/testhelper.cpp
index 94fc21c5140..2aaf32661ea 100644
--- a/memfilepersistence/src/tests/helper/testhelper.cpp
+++ b/memfilepersistence/src/tests/helper/testhelper.cpp
@@ -1,10 +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 <tests/helper/testhelper.h>
+#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/log/log.h>
-#include <vespa/vespalib/io/fileutil.h>
-#include <vespa/vespalib/testkit/testapp.h>
LOG_SETUP(".testhelper");
namespace storage {
diff --git a/memfilepersistence/src/tests/init/filescannertest.cpp b/memfilepersistence/src/tests/init/filescannertest.cpp
index 2a69804a295..39de83d5c55 100644
--- a/memfilepersistence/src/tests/init/filescannertest.cpp
+++ b/memfilepersistence/src/tests/init/filescannertest.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/document/bucket/bucketid.h>
-#include <iomanip>
#include <vespa/memfilepersistence/device/devicemanager.h>
#include <vespa/memfilepersistence/init/filescanner.h>
#include <vespa/memfilepersistence/mapper/bucketdirectorymapper.h>
@@ -10,9 +7,11 @@
#include <vespa/storageframework/defaultimplementation/clock/realclock.h>
#include <vespa/vdslib/state/nodestate.h>
#include <vespa/vdstestlib/cppunit/macros.h>
+#include <vespa/document/bucket/bucketid.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/random.h>
+#include <iomanip>
#include <sys/errno.h>
namespace storage {
diff --git a/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp b/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp
index 2f7913b0e1f..bc450a7a84a 100644
--- a/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp
+++ b/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp
@@ -1,12 +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/vdstestlib/cppunit/macros.h>
-#include <tests/spi/memfiletestutils.h>
-#include <tests/spi/simulatedfailurefile.h>
-#include <tests/spi/options_builder.h>
+#include "memfiletestutils.h"
+#include "simulatedfailurefile.h"
+#include "options_builder.h"
#include <vespa/document/fieldset/fieldsetrepo.h>
#include <vespa/document/fieldset/fieldsets.h>
+#include <vespa/vdstestlib/cppunit/macros.h>
+
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/tests/spi/buffer_test.cpp b/memfilepersistence/src/tests/spi/buffer_test.cpp
index 0addb1032f5..6c098baef07 100644
--- a/memfilepersistence/src/tests/spi/buffer_test.cpp
+++ b/memfilepersistence/src/tests/spi/buffer_test.cpp
@@ -1,5 +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/vdstestlib/cppunit/macros.h>
#include <vespa/memfilepersistence/mapper/buffer.h>
diff --git a/memfilepersistence/src/tests/spi/buffered_file_writer_test.cpp b/memfilepersistence/src/tests/spi/buffered_file_writer_test.cpp
index b59e8a32258..69f64376f60 100644
--- a/memfilepersistence/src/tests/spi/buffered_file_writer_test.cpp
+++ b/memfilepersistence/src/tests/spi/buffered_file_writer_test.cpp
@@ -1,5 +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/vdstestlib/cppunit/macros.h>
#include <vespa/memfilepersistence/mapper/bufferedfilewriter.h>
#include <vespa/memfilepersistence/mapper/buffer.h>
diff --git a/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp b/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp
index 673a72068b7..4372a8a45a7 100644
--- a/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp
+++ b/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp
@@ -1,14 +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 <set>
-#include <vector>
-#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h>
#include <tests/spi/memfiletestutils.h>
#include <tests/spi/simulatedfailurefile.h>
#include <tests/spi/options_builder.h>
-#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/document/select/parser.h>
namespace storage {
diff --git a/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp b/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp
index 78601b461ab..7da80a78913 100644
--- a/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp
+++ b/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp
@@ -1,10 +1,7 @@
// 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 "memfiletestutils.h"
#include <vespa/document/datatype/documenttype.h>
-#include <tests/spi/memfiletestutils.h>
-#include <tests/spi/simulatedfailurefile.h>
-#include <vespa/vdstestlib/cppunit/macros.h>
using document::DocumentType;
diff --git a/memfilepersistence/src/tests/spi/memcachetest.cpp b/memfilepersistence/src/tests/spi/memcachetest.cpp
index 07697b79cac..7eece580b0a 100644
--- a/memfilepersistence/src/tests/spi/memcachetest.cpp
+++ b/memfilepersistence/src/tests/spi/memcachetest.cpp
@@ -1,10 +1,8 @@
// 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/memfilepersistence/memfile/memfilecache.h>
#include <vespa/storageframework/defaultimplementation/memory/simplememorylogic.h>
#include <tests/spi/memfiletestutils.h>
-#include <vespa/vdstestlib/cppunit/macros.h>
namespace storage {
diff --git a/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp b/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp
index eefe962979d..265054a02ba 100644
--- a/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp
+++ b/memfilepersistence/src/tests/spi/memfileautorepairtest.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/memfilepersistence/mapper/memfilemapper.h>
#include <vespa/memfilepersistence/mapper/memfile_v1_serializer.h>
#include <vespa/memfilepersistence/mapper/memfile_v1_verifier.h>
-#include <vespa/memfilepersistence/mapper/fileinfo.h>
-#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h>
#include <tests/spi/memfiletestutils.h>
-#include <vespa/vdstestlib/cppunit/macros.h>
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/tests/spi/memfiletestutils.h b/memfilepersistence/src/tests/spi/memfiletestutils.h
index d6bdbc3ff96..5eeddf18818 100644
--- a/memfilepersistence/src/tests/spi/memfiletestutils.h
+++ b/memfilepersistence/src/tests/spi/memfiletestutils.h
@@ -79,7 +79,7 @@ public:
void setupDisks(uint32_t disks);
- void tearDown() {
+ void tearDown() override{
_env.reset();
_componentRegister.reset();
_memoryManager.reset();
@@ -290,7 +290,7 @@ public:
class SingleDiskMemFileTestUtils : public MemFileTestUtils
{
public:
- void setUp() {
+ void setUp() override {
setupDisks(1);
}
};
diff --git a/memfilepersistence/src/tests/spi/memfilev1serializertest.cpp b/memfilepersistence/src/tests/spi/memfilev1serializertest.cpp
index ad20a28ed0c..f612bec1189 100644
--- a/memfilepersistence/src/tests/spi/memfilev1serializertest.cpp
+++ b/memfilepersistence/src/tests/spi/memfilev1serializertest.cpp
@@ -1,11 +1,8 @@
// 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/memfilepersistence/mapper/memfilemapper.h>
#include <vespa/memfilepersistence/mapper/memfile_v1_serializer.h>
-#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h>
#include <tests/spi/memfiletestutils.h>
-#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/memfilepersistence/mapper/locationreadplanner.h>
#include <tests/spi/simulatedfailurefile.h>
#include <tests/spi/options_builder.h>
@@ -229,23 +226,16 @@ struct DummyMemFileIOInterface : MemFileIOInterface {
void clear(DocumentPart) override {}
bool verifyConsistent() const override { return true; }
void move(const FileSpecification&) override {}
- DataLocation copyCache(const MemFileIOInterface&,
- DocumentPart,
- DataLocation) override
- {
+ DataLocation copyCache(const MemFileIOInterface&, DocumentPart, DataLocation) override {
return DataLocation();
}
- void close() override {}
+ void close() override {};
bool isCached(DataLocation, DocumentPart) const override { return false; }
bool isPersisted(DataLocation, DocumentPart) const override { return false; }
- uint32_t getSerializedSize(DocumentPart,
- DataLocation) const override { return 0; }
+ uint32_t getSerializedSize(DocumentPart, DataLocation) const override { return 0; }
- void ensureCached(Environment&,
- DocumentPart,
- const std::vector<DataLocation>&) override
- {}
+ void ensureCached(Environment&, DocumentPart, const std::vector<DataLocation>&) override {}
size_t getCachedSize(DocumentPart) const override { return 0; }
};
diff --git a/memfilepersistence/src/tests/spi/memfilev1verifiertest.cpp b/memfilepersistence/src/tests/spi/memfilev1verifiertest.cpp
index 51951e22aea..632bded6c6c 100644
--- a/memfilepersistence/src/tests/spi/memfilev1verifiertest.cpp
+++ b/memfilepersistence/src/tests/spi/memfilev1verifiertest.cpp
@@ -1,14 +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/memfilepersistence/mapper/memfilemapper.h>
#include <vespa/memfilepersistence/mapper/memfile_v1_serializer.h>
#include <vespa/memfilepersistence/mapper/memfile_v1_verifier.h>
-#include <vespa/memfilepersistence/mapper/fileinfo.h>
-#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h>
#include <tests/spi/memfiletestutils.h>
-#include <vespa/vdstestlib/cppunit/macros.h>
-#include <tests/spi/simulatedfailurefile.h>
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/tests/spi/providerconformancetest.cpp b/memfilepersistence/src/tests/spi/providerconformancetest.cpp
index 8bc2237265b..f85d6e0b872 100644
--- a/memfilepersistence/src/tests/spi/providerconformancetest.cpp
+++ b/memfilepersistence/src/tests/spi/providerconformancetest.cpp
@@ -1,19 +1,8 @@
// 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>
-#include <vespa/vdstestlib/cppunit/macros.h>
+#include "memfiletestutils.h"
#include <vespa/persistence/conformancetest/conformancetest.h>
-#include <vespa/storageframework/defaultimplementation/component/componentregisterimpl.h>
-#include <vespa/storageframework/defaultimplementation/clock/realclock.h>
-#include <vespa/storageframework/defaultimplementation/memory/memorymanager.h>
#include <vespa/storageframework/defaultimplementation/memory/simplememorylogic.h>
-#include <vespa/storageframework/generic/memory/memorymanagerinterface.h>
-#include <vespa/memfilepersistence/memfile/memfilecache.h>
-#include <vespa/memfilepersistence/spi/memfilepersistenceprovider.h>
-#include <tests/spi/memfiletestutils.h>
-
-LOG_SETUP(".test.dummyimpl");
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/tests/spi/shared_data_location_tracker_test.cpp b/memfilepersistence/src/tests/spi/shared_data_location_tracker_test.cpp
index fbf7badf5e4..fa15cff67fd 100644
--- a/memfilepersistence/src/tests/spi/shared_data_location_tracker_test.cpp
+++ b/memfilepersistence/src/tests/spi/shared_data_location_tracker_test.cpp
@@ -1,5 +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/vdstestlib/cppunit/macros.h>
#include <vespa/memfilepersistence/memfile/shared_data_location_tracker.h>
diff --git a/memfilepersistence/src/tests/spi/simplememfileiobuffertest.cpp b/memfilepersistence/src/tests/spi/simplememfileiobuffertest.cpp
index ffe7972552f..cb1bc057705 100644
--- a/memfilepersistence/src/tests/spi/simplememfileiobuffertest.cpp
+++ b/memfilepersistence/src/tests/spi/simplememfileiobuffertest.cpp
@@ -1,7 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h>
-#include <vespa/vdstestlib/cppunit/macros.h>
#include <tests/spi/memfiletestutils.h>
#include <tests/spi/options_builder.h>
@@ -51,19 +50,15 @@ class SimpleMemFileIOBufferTest : public SingleDiskMemFileTestUtils
public:
class DummyFileReader : public VersionSerializer {
public:
- virtual FileVersion getFileVersion() override { return FileVersion(); }
- virtual void loadFile(MemFile&, Environment&, Buffer&, uint64_t ) override {}
- virtual FlushResult flushUpdatesToFile(MemFile&, Environment&) override {
+ FileVersion getFileVersion() override { return FileVersion(); }
+ void loadFile(MemFile&, Environment&, Buffer&, uint64_t ) override {}
+ FlushResult flushUpdatesToFile(MemFile&, Environment&) override {
return FlushResult::TooSmall;
}
- virtual void rewriteFile(MemFile&, Environment&) override {}
- virtual bool verify(MemFile&, Environment&,
- std::ostream&, bool, uint16_t) override { return false; };
- virtual void cacheLocations(MemFileIOInterface&,
- Environment&,
- const Options&,
- DocumentPart,
- const std::vector<DataLocation>&) override {}
+ void rewriteFile(MemFile&, Environment&) override {}
+ bool verify(MemFile&, Environment&, std::ostream&, bool, uint16_t) override { return false; };
+ void cacheLocations(MemFileIOInterface&, Environment&, const Options&,
+ DocumentPart, const std::vector<DataLocation>&) override {}
};
DummyFileReader dfr;
diff --git a/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp b/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp
index 75eab5c2972..e1c87dd1cf3 100644
--- a/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp
+++ b/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp
@@ -1,10 +1,7 @@
// 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 "memfiletestutils.h"
#include <vespa/document/datatype/documenttype.h>
-#include <tests/spi/memfiletestutils.h>
-#include <tests/spi/simulatedfailurefile.h>
-#include <vespa/vdstestlib/cppunit/macros.h>
using document::DocumentType;
diff --git a/memfilepersistence/src/tests/testrunner.cpp b/memfilepersistence/src/tests/testrunner.cpp
index 16027870c47..5baa0f60b6e 100644
--- a/memfilepersistence/src/tests/testrunner.cpp
+++ b/memfilepersistence/src/tests/testrunner.cpp
@@ -1,14 +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 <iostream>
-#include <vespa/log/log.h>
#include <vespa/vdstestlib/cppunit/cppunittestrunner.h>
+#include <vespa/log/log.h>
LOG_SETUP("persistencecppunittests");
int
-main(int argc, char **argv)
+main(int argc, const char *argv[])
{
vdstestlib::CppUnitTestRunner testRunner;
return testRunner.run(argc, argv);
diff --git a/memfilepersistence/src/tests/tools/vdsdisktooltest.cpp b/memfilepersistence/src/tests/tools/vdsdisktooltest.cpp
index 0f36f0a0571..5de40311b2f 100644
--- a/memfilepersistence/src/tests/tools/vdsdisktooltest.cpp
+++ b/memfilepersistence/src/tests/tools/vdsdisktooltest.cpp
@@ -1,6 +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/config/subscription/configuri.h>
#include <vespa/memfilepersistence/tools/vdsdisktool.h>
#include <vespa/storageframework/defaultimplementation/clock/fakeclock.h>
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/config_aliases.h b/memfilepersistence/src/vespa/memfilepersistence/common/config_aliases.h
index 506699f7e31..66508d7d659 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/config_aliases.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/config_aliases.h
@@ -9,8 +9,7 @@ namespace storage {
namespace memfile {
// Friendly aliases to painfully long config names.
-using MemFilePersistenceConfig
- = vespa::config::storage::StorMemfilepersistenceConfig;
+using MemFilePersistenceConfig= vespa::config::storage::StorMemfilepersistenceConfig;
using PersistenceConfig = vespa::config::content::PersistenceConfig;
using DevicesConfig = vespa::config::storage::StorDevicesConfig;
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/config_lock_guard.cpp b/memfilepersistence/src/vespa/memfilepersistence/common/config_lock_guard.cpp
index 1e68024d8dd..71f3cf0b410 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/config_lock_guard.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/config_lock_guard.cpp
@@ -1,7 +1,7 @@
// 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/memfilepersistence/common/config_lock_guard.h>
-#include <vespa/memfilepersistence/common/environment.h>
+
+#include "config_lock_guard.h"
+#include "environment.h"
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/config_lock_guard.h b/memfilepersistence/src/vespa/memfilepersistence/common/config_lock_guard.h
index b97b61010af..d474a61f48b 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/config_lock_guard.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/config_lock_guard.h
@@ -1,10 +1,9 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/memfilepersistence/common/config_aliases.h>
-#include <vespa/memfilepersistence/common/options.h>
+#include "config_aliases.h"
+#include "options.h"
#include <vespa/vespalib/util/rwlock.h>
-#include <memory>
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/environment.h b/memfilepersistence/src/vespa/memfilepersistence/common/environment.h
index 243c9054ded..0f81d61a943 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/environment.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/environment.h
@@ -13,15 +13,16 @@
#pragma once
-#include <vespa/config/helper/configfetcher.h>
-#include <vespa/memfilepersistence/common/options.h>
-#include <vespa/memfilepersistence/common/types.h>
-#include <vespa/memfilepersistence/common/config_lock_guard.h>
-#include <vespa/memfilepersistence/common/config_aliases.h>
+#include "options.h"
+#include "types.h"
+#include "config_lock_guard.h"
+#include "config_aliases.h"
+#include <vespa/memfilepersistence/device/mountpointlist.h>
#include <vespa/storageframework/storageframework.h>
#include <vespa/vespalib/io/fileutil.h>
-#include <vespa/memfilepersistence/device/mountpointlist.h>
#include <vespa/document/bucket/bucketidfactory.h>
+#include <vespa/config/helper/configfetcher.h>
+
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/exceptions.cpp b/memfilepersistence/src/vespa/memfilepersistence/common/exceptions.cpp
index 16235f21707..65715f8b2b6 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/exceptions.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/exceptions.cpp
@@ -1,7 +1,6 @@
// 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/memfilepersistence/common/exceptions.h>
+#include "exceptions.h"
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/exceptions.h b/memfilepersistence/src/vespa/memfilepersistence/common/exceptions.h
index 03edf7e7a83..d4bbfe1b621 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/exceptions.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/exceptions.h
@@ -15,7 +15,7 @@
#pragma once
-#include <vespa/memfilepersistence/common/filespecification.h>
+#include "filespecification.h"
#include <vespa/memfilepersistence/memfile/memslot.h>
#include <vespa/vespalib/util/exceptions.h>
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/filespecification.h b/memfilepersistence/src/vespa/memfilepersistence/common/filespecification.h
index 23e4857fdb3..fa4fa23dc5a 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/filespecification.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/filespecification.h
@@ -10,9 +10,9 @@
#pragma once
-#include <vespa/vespalib/util/printable.h>
+#include "types.h"
#include <vespa/memfilepersistence/device/directory.h>
-#include <vespa/memfilepersistence/common/types.h>
+#include <vespa/vespalib/util/printable.h>
namespace storage {
namespace memfile {
@@ -37,8 +37,7 @@ public:
const String& getPath() const { return _path; }
FileVersion getWantedFileVersion() const { return _wantedVersion; }
- virtual void print(std::ostream& out, bool verbose,
- const std::string& indent) const override;
+ void print(std::ostream& out, bool verbose, const std::string& indent) const override;
bool operator==(const FileSpecification& o) const {
return (_bucketId == o._bucketId && _dir == o._dir
@@ -48,4 +47,3 @@ public:
} // storage
} // memfile
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/options.h b/memfilepersistence/src/vespa/memfilepersistence/common/options.h
index ecc11251f89..6199bf59f37 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/options.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/options.h
@@ -16,13 +16,12 @@
#pragma once
-#include <vespa/vespalib/util/printable.h>
-#include <vespa/fastos/types.h> // For uint32_t on linux
-#include <string>
-#include <vespa/vespalib/stllike/string.h>
+
#include <vespa/storageframework/storageframework.h>
#include <vespa/config-stor-memfilepersistence.h>
#include <vespa/config-persistence.h>
+#include <vespa/vespalib/util/printable.h>
+#include <vespa/vespalib/stllike/string.h>
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/slotmatcher.cpp b/memfilepersistence/src/vespa/memfilepersistence/common/slotmatcher.cpp
index dd045239877..04a86d0af91 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/slotmatcher.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/slotmatcher.cpp
@@ -1,6 +1,6 @@
// 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/memfilepersistence/common/slotmatcher.h>
+
+#include "slotmatcher.h"
#include <vespa/memfilepersistence/memfile/memfile.h>
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/types.h b/memfilepersistence/src/vespa/memfilepersistence/common/types.h
index 58643275503..ab6ae1e52f8 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/types.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/types.h
@@ -15,12 +15,10 @@
*/
#pragma once
-#include <vespa/document/bucket/bucketid.h>
-#include <vespa/document/base/documentid.h>
-#include <vespa/document/fieldvalue/document.h>
+
#include <vespa/storageframework/storageframework.h>
-#include <vespa/vespalib/stllike/string.h>
#include <vespa/persistence/spi/bucketinfo.h>
+#include <vespa/document/fieldvalue/document.h>
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/device.cpp b/memfilepersistence/src/vespa/memfilepersistence/device/device.cpp
index 88283065790..57be8a3bf97 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/device.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/device.cpp
@@ -1,13 +1,7 @@
// 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/memfilepersistence/device/device.h>
-
-#include <vespa/log/log.h>
-#include <vespa/memfilepersistence/device/ioevent.h>
-
-LOG_SETUP(".persistence.device");
-
-#include <algorithm>
+#include "device.h"
+#include "ioevent.h"
+#include <sstream>
namespace storage {
@@ -15,12 +9,9 @@ namespace memfile {
Device::Device(DeviceManager& manager)
: _manager(manager)
-{
-}
+{}
-Device::~Device()
-{
-}
+Device::~Device() {}
std::string Device::getStateString(State s)
{
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/device.h b/memfilepersistence/src/vespa/memfilepersistence/device/device.h
index dd582ff327a..66a925ac08b 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/device.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/device.h
@@ -12,7 +12,6 @@
#include <vespa/vespalib/util/printable.h>
#include <list>
-#include <string>
namespace storage {
@@ -63,9 +62,7 @@ public:
virtual const IOEvent* getLastEvent() const = 0;
const std::list<IOEvent>& getEvents() const { return _events; }
-
- void print(std::ostream& out, bool verbose,
- const std::string& indent) const;
+ void print(std::ostream& out, bool verbose, const std::string& indent) const override;
};
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/devicemanager.cpp b/memfilepersistence/src/vespa/memfilepersistence/device/devicemanager.cpp
index 9d77b84d4c6..37c93368c03 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/devicemanager.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/devicemanager.cpp
@@ -1,8 +1,6 @@
// 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/memfilepersistence/device/devicemanager.h>
-#include <vespa/memfilepersistence/device/devicemapper.h>
+#include "devicemanager.h"
#include <vespa/vespalib/util/exceptions.h>
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/devicemanager.h b/memfilepersistence/src/vespa/memfilepersistence/device/devicemanager.h
index d4528ad10b6..2b283984c0b 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/devicemanager.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/devicemanager.h
@@ -9,27 +9,27 @@
*/
#pragma once
-#include <vespa/memfilepersistence/device/devicemapper.h>
-#include <vespa/memfilepersistence/device/directory.h>
-#include <vespa/memfilepersistence/device/disk.h>
-#include <vespa/memfilepersistence/device/ioevent.h>
-#include <vespa/memfilepersistence/device/partition.h>
-#include <set>
-#include <vector>
+#include "devicemapper.h"
+#include "directory.h"
+#include "disk.h"
+#include "ioevent.h"
+#include "partition.h"
#include <vespa/vespalib/util/xmlserializable.h>
#include <vespa/storageframework/generic/clock/clock.h>
+#include <set>
namespace storage {
namespace memfile {
class DeviceManager : public vespalib::XmlSerializable {
+ using StatfsPolicy = vespa::config::storage::StorDevicesConfig::StatfsPolicy;
DeviceMapper::UP _deviceMapper;
std::map<int, Disk::SP> _disks;
std::map<std::string, Partition::SP> _partitions;
std::map<std::string, Directory::SP> _directories;
std::set<IOEventListener*> _eventListeners;
- vespa::config::storage::StorDevicesConfig::StatfsPolicy _statPolicy;
+ StatfsPolicy _statPolicy;
uint32_t _statPeriod;
const framework::Clock& _clock;
@@ -41,11 +41,9 @@ class DeviceManager : public vespalib::XmlSerializable {
public:
using UP = std::unique_ptr<DeviceManager>;
- DeviceManager(DeviceMapper::UP mapper,
- const framework::Clock& clock);
+ DeviceManager(DeviceMapper::UP mapper, const framework::Clock& clock);
- void setPartitionMonitorPolicy(
- vespa::config::storage::StorDevicesConfig::StatfsPolicy, uint32_t period = 0);
+ void setPartitionMonitorPolicy(StatfsPolicy, uint32_t period = 0);
void notifyDiskEvent(Disk& disk, const IOEvent& e);
void notifyDirectoryEvent(Directory& dir, const IOEvent& e);
@@ -62,11 +60,10 @@ public:
std::vector<Directory::SP> getDirectories(const Disk& disk) const;
std::vector<Directory::SP> getDirectories(const Partition& part) const;
- vespa::config::storage::StorDevicesConfig::StatfsPolicy getStatPolicy() const
- { return _statPolicy; }
+ StatfsPolicy getStatPolicy() const { return _statPolicy; }
uint32_t getStatPeriod() const { return _statPeriod; }
- virtual void printXml(vespalib::XmlOutputStream&) const;
+ void printXml(vespalib::XmlOutputStream&) const override;
const framework::Clock& getClock() const { return _clock; }
};
@@ -74,4 +71,3 @@ public:
} // memfile
} // storage
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/devicemapper.cpp b/memfilepersistence/src/vespa/memfilepersistence/device/devicemapper.cpp
index e6f45fe9e4b..8ddf215d616 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/devicemapper.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/devicemapper.cpp
@@ -1,14 +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/memfilepersistence/device/devicemapper.h>
+#include "devicemapper.h"
#include <vespa/vespalib/text/stringtokenizer.h>
+#include <vespa/vespalib/util/exceptions.h>
#include <fstream>
-#include <vespa/log/log.h>
#include <sstream>
-#include <sys/stat.h>
-#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.devicemapper");
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/devicemapper.h b/memfilepersistence/src/vespa/memfilepersistence/device/devicemapper.h
index 739fa903a00..2ddb8551384 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/devicemapper.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/devicemapper.h
@@ -55,7 +55,7 @@ class SimpleDeviceMapper : public DeviceMapper {
public:
SimpleDeviceMapper() : _devices(), _lastDevice(0) {}
- uint64_t getPartitionId(const std::string& fileOnFS) const {
+ uint64_t getPartitionId(const std::string& fileOnFS) const override {
std::map<std::string, int>::const_iterator it = _devices.find(fileOnFS);
if (it != _devices.end()) {
return it->second;
@@ -64,12 +64,11 @@ public:
_devices[fileOnFS] = dev;
return dev;
}
- std::string getMountPoint(const std::string& path) const { return path; }
- virtual uint64_t getDeviceId(const std::string& fileOnFS) const {
+ std::string getMountPoint(const std::string& path) const override { return path; }
+ uint64_t getDeviceId(const std::string& fileOnFS) const override {
return getPartitionId(fileOnFS);
}
- virtual const char* getName() const
- { return "Simple (All directories on individual fake devices)"; }
+ const char* getName() const override { return "Simple (All directories on individual fake devices)"; }
};
/**
@@ -88,18 +87,16 @@ struct AdvancedDeviceMapper : public DeviceMapper {
AdvancedDeviceMapper();
void init(std::istream&);
- virtual std::string getMountPoint(const std::string& fileOnFS) const;
- virtual uint64_t getPartitionId(const std::string& fileOnFS) const;
- virtual uint64_t getDeviceId(const std::string& fileOnFS) const {
+ std::string getMountPoint(const std::string& fileOnFS) const override;
+ uint64_t getPartitionId(const std::string& fileOnFS) const override;
+ uint64_t getDeviceId(const std::string& fileOnFS) const override {
// Not found a way to detect partitions on common device.
// Returning partition ids for now.
return getPartitionId(fileOnFS);
}
- virtual const char* getName() const
- { return "Advanced (Read devices attempted found)"; }
+ const char* getName() const override { return "Advanced (Read devices attempted found)"; }
};
}
} // storage
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/directory.cpp b/memfilepersistence/src/vespa/memfilepersistence/device/directory.cpp
index a108ad4d4d9..8614d857ac8 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/directory.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/directory.cpp
@@ -1,11 +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 <vespa/memfilepersistence/device/directory.h>
-#include <vespa/log/log.h>
-#include <vespa/memfilepersistence/device/devicemanager.h>
+#include "directory.h"
+#include "devicemanager.h"
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.device.directory");
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/directory.h b/memfilepersistence/src/vespa/memfilepersistence/device/directory.h
index b02d12a4552..c4d7f3492f9 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/directory.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/directory.h
@@ -10,7 +10,7 @@
*/
#pragma once
-#include <vespa/memfilepersistence/device/partition.h>
+#include "partition.h"
namespace storage {
@@ -39,16 +39,15 @@ public:
Partition& getPartition() { return *_partition; }
const Partition& getPartition() const { return *_partition; }
- const IOEvent* getLastEvent() const;
- virtual void addEvent(const IOEvent& e);
+ const IOEvent* getLastEvent() const override;
+ void addEvent(const IOEvent& e) override;
virtual void addEvent(Device::State s,
const std::string& description,
const std::string& location);
State getState() const;
bool isOk() const { return (getLastEvent() == 0); }
- void print(std::ostream& out, bool verbose,
- const std::string& indent) const;
+ void print(std::ostream& out, bool verbose, const std::string& indent) const override;
bool operator==(const Directory& d) const { return (_path == d._path); }
bool operator!=(const Directory& d) const { return (_path != d._path); }
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/disk.cpp b/memfilepersistence/src/vespa/memfilepersistence/device/disk.cpp
index 4e207d326ed..706b2cab143 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/disk.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/disk.cpp
@@ -1,11 +1,7 @@
// 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/memfilepersistence/device/disk.h>
-#include <vespa/log/log.h>
-#include <vespa/memfilepersistence/device/devicemanager.h>
-
-LOG_SETUP(".persistence.device.disk");
+#include "disk.h"
+#include "devicemanager.h"
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/disk.h b/memfilepersistence/src/vespa/memfilepersistence/device/disk.h
index 9e63b7b7c68..5647976c4d4 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/disk.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/disk.h
@@ -14,7 +14,7 @@
#pragma once
-#include <vespa/memfilepersistence/device/device.h>
+#include "device.h"
namespace storage {
@@ -32,16 +32,14 @@ public:
uint64_t getId() const { return _id; }
- virtual void addEvent(const IOEvent& e);
- const IOEvent* getLastEvent() const;
+ void addEvent(const IOEvent& e) override;
+ const IOEvent* getLastEvent() const override;
bool operator==(const Disk& disk) const { return (_id == disk._id); }
bool operator!=(const Disk& disk) const { return (_id != disk._id); }
- void print(std::ostream& out, bool verbose,
- const std::string& indent) const;
+ void print(std::ostream& out, bool verbose, const std::string& indent) const override;
};
} // memfile
} // storage
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/ioevent.cpp b/memfilepersistence/src/vespa/memfilepersistence/device/ioevent.cpp
index d6b8a819823..a95651f6514 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/ioevent.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/ioevent.cpp
@@ -1,8 +1,7 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/memfilepersistence/device/ioevent.h>
-#include <vespa/memfilepersistence/device/device.h>
+
+#include "ioevent.h"
#include <vespa/vespalib/util/exceptions.h>
-#include <cerrno>
#include <ostream>
namespace storage {
@@ -15,8 +14,12 @@ IOEvent::IOEvent()
_location(),
_global(false),
_timestamp(0)
-{
-}
+{}
+
+IOEvent::IOEvent(const IOEvent &) = default;
+IOEvent & IOEvent::operator = (const IOEvent &) = default;
+
+IOEvent::~IOEvent() {}
namespace {
vespalib::string stripBacktrace(const vespalib::string& s) {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/ioevent.h b/memfilepersistence/src/vespa/memfilepersistence/device/ioevent.h
index e801d886bca..16737f9b386 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/ioevent.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/ioevent.h
@@ -23,6 +23,12 @@ public:
const vespalib::string & description,
const vespalib::string & location,
bool global = false);
+ IOEvent(const IOEvent &);
+ IOEvent & operator = (const IOEvent &);
+ IOEvent(IOEvent &&) = default;
+ IOEvent & operator = (IOEvent &&) = default;
+
+ ~IOEvent();
static IOEvent createEventFromErrno(uint32_t timestamp,
int error,
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/mountpointlist.cpp b/memfilepersistence/src/vespa/memfilepersistence/device/mountpointlist.cpp
index 63d3251fead..e7ac0e473e6 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/mountpointlist.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/mountpointlist.cpp
@@ -1,22 +1,21 @@
// 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/memfilepersistence/device/mountpointlist.h>
+#include "mountpointlist.h"
+#include "devicemanager.h"
+#include <vespa/memfilepersistence/common/exceptions.h>
+#include <vespa/persistence/spi/exceptions.h>
+#include <vespa/vdslib/state/nodestate.h>
#include <vespa/config/helper/configfetcher.h>
+#include <vespa/vespalib/io/fileutil.h>
+#include <vespa/vespalib/util/xmlserializable.h>
#include <vespa/vespalib/util/guard.h>
#include <vespa/vespalib/text/stringtokenizer.h>
-#include <errno.h>
+#include <cerrno>
#include <fstream>
-#include <vespa/log/log.h>
-#include <vespa/persistence/spi/exceptions.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <vespa/memfilepersistence/common/exceptions.h>
-#include <vespa/memfilepersistence/device/devicemanager.h>
-#include <vespa/vespalib/io/fileutil.h>
-#include <vespa/vdslib/state/nodestate.h>
-#include <vespa/vespalib/util/xmlserializable.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.mountpointlist");
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/mountpointlist.h b/memfilepersistence/src/vespa/memfilepersistence/device/mountpointlist.h
index 0bd035097f1..d4ba15529f9 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/mountpointlist.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/mountpointlist.h
@@ -16,12 +16,12 @@
#pragma once
-#include <vespa/vespalib/util/printable.h>
-#include <vespa/memfilepersistence/device/devicemanager.h>
-#include <vespa/memfilepersistence/device/directory.h>
+#include "devicemanager.h"
+#include "directory.h"
#include <vespa/storageframework/storageframework.h>
-#include <vector>
#include <vespa/persistence/spi/persistenceprovider.h>
+#include <vespa/vespalib/util/printable.h>
+
namespace storage {
namespace lib {
@@ -111,9 +111,7 @@ struct MountPointList : public framework::XmlStatusReporter {
uint16_t findIndex(const Directory& dir) const;
- // XmlStatusReporter implementation
- vespalib::string reportXmlStatus(vespalib::xml::XmlOutputStream&,
- const framework::HttpUrlPath&) const;
+ vespalib::string reportXmlStatus(vespalib::xml::XmlOutputStream&, const framework::HttpUrlPath&) const override;
/**
* Returns the current state of the mountpoints.
@@ -133,5 +131,3 @@ private:
} // memfile
} // storage
-
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/partition.cpp b/memfilepersistence/src/vespa/memfilepersistence/device/partition.cpp
index 2829ae8a212..3bd855553c7 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/partition.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/partition.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 <vespa/memfilepersistence/device/partition.h>
-
-#include <vespa/log/log.h>
-#include <vespa/memfilepersistence/device/devicemanager.h>
+#include "partition.h"
+#include "devicemanager.h"
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.device.partition");
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/partition.h b/memfilepersistence/src/vespa/memfilepersistence/device/partition.h
index 1dc9fdacd41..6b6938dbb2f 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/partition.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/partition.h
@@ -11,8 +11,8 @@
#pragma once
-#include <vespa/memfilepersistence/device/disk.h>
-#include <vespa/memfilepersistence/device/partitionmonitor.h>
+#include "disk.h"
+#include "partitionmonitor.h"
namespace storage {
@@ -43,14 +43,11 @@ public:
PartitionMonitor* getMonitor() { return _monitor.get(); }
const PartitionMonitor* getMonitor() const { return _monitor.get(); }
- virtual void addEvent(const IOEvent& e);
- const IOEvent* getLastEvent() const;
-
- void print(std::ostream& out, bool verbose,
- const std::string& indent) const;
+ void addEvent(const IOEvent& e) override;
+ const IOEvent* getLastEvent() const override;
+ void print(std::ostream& out, bool verbose, const std::string& indent) const override;
bool operator==(const Partition& p) const { return (_id == p._id); }
bool operator!=(const Partition& p) const { return (_id != p._id); }
-
};
} // memfile
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.cpp b/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.cpp
index b483d4691c4..b0fa6cf6667 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.cpp
@@ -26,8 +26,7 @@ namespace {
}
struct RealStatter : public PartitionMonitor::Statter {
- virtual void statFileSystem(const std::string& file, struct statvfs& info) override
- {
+ void statFileSystem(const std::string& file, struct statvfs& info) override {
if (statvfs(file.c_str(), &info) != 0) {
vespalib::asciistream ost;
ost << "Failed to run statvfs to find data on disk containing "
diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.h b/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.h
index 8e513b0f42f..4b44b5b4c38 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.h
@@ -11,11 +11,12 @@
*/
#pragma once
-#include <vespa/vespalib/util/printable.h>
-#include <sys/statvfs.h>
#include <vespa/config-stor-devices.h>
#include <vespa/vespalib/util/sync.h>
#include <vespa/vespalib/util/xmlserializable.h>
+#include <vespa/vespalib/util/printable.h>
+#include <sys/statvfs.h>
+
namespace storage {
@@ -129,8 +130,7 @@ public:
*/
void removingData(uint64_t dataSize);
- virtual void print(std::ostream& out, bool verbose,
- const std::string& indent) const;
+ void print(std::ostream& out, bool verbose, const std::string& indent) const override ;
/**
* Calculate the file system id for a given file. Used when wanting an
@@ -143,8 +143,7 @@ public:
void overrideRealStat(uint32_t blockSize, uint32_t totalBlocks,
uint32_t blocksUsed, float inodeFillRate = 0.1);
- virtual void printXml(vespalib::XmlOutputStream&) const;
-
+ void printXml(vespalib::XmlOutputStream&) const override;
private:
void updateIfNeeded() const;
@@ -153,4 +152,3 @@ private:
} // memfile
} // storage
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/bucketdirectorymapper.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/bucketdirectorymapper.cpp
index 956e806968d..6d151cbbb7c 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/bucketdirectorymapper.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/bucketdirectorymapper.cpp
@@ -1,8 +1,6 @@
// 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/memfilepersistence/mapper/bucketdirectorymapper.h>
-
+#include "bucketdirectorymapper.h"
#include <vespa/document/bucket/bucketid.h>
#include <vespa/vespalib/util/random.h>
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/bucketdirectorymapper.h b/memfilepersistence/src/vespa/memfilepersistence/mapper/bucketdirectorymapper.h
index a12c0f9c7cb..db3df7531f4 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/bucketdirectorymapper.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/bucketdirectorymapper.h
@@ -17,6 +17,7 @@
#pragma once
#include <vector>
+#include <cstdint>
namespace document {
class BucketId;
@@ -37,4 +38,3 @@ public:
}
}
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/buffer.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/buffer.cpp
index acf7ac6a69d..9837a58ae29 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/buffer.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/buffer.cpp
@@ -1,9 +1,7 @@
// 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/memfilepersistence/mapper/buffer.h>
-#include <algorithm>
-#include <stdlib.h>
+#include "buffer.h"
+#include <cstring>
using vespalib::alloc::MemoryAllocator;
using vespalib::alloc::Alloc;
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/bufferedfilewriter.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/bufferedfilewriter.cpp
index 1cc765ada5a..65b92e212f5 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/bufferedfilewriter.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/bufferedfilewriter.cpp
@@ -1,12 +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/memfilepersistence/mapper/bufferedfilewriter.h>
+#include "bufferedfilewriter.h"
#include <vespa/vespalib/util/guard.h>
-#include <vespa/log/log.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.memfile.bufferedfilewriter");
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/locationreadplanner.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/locationreadplanner.cpp
index e853e374943..3dadceb1e2e 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/locationreadplanner.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/locationreadplanner.cpp
@@ -1,7 +1,6 @@
// 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/memfilepersistence/mapper/locationreadplanner.h>
+#include "locationreadplanner.h"
#include <vespa/memfilepersistence/memfile/memfileiointerface.h>
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/memfile_v1_serializer.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/memfile_v1_serializer.cpp
index 742a37fcf36..d9cc0c35cc4 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/memfile_v1_serializer.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/memfile_v1_serializer.cpp
@@ -3,16 +3,13 @@
#include "memfile_v1_serializer.h"
#include "memfile_v1_verifier.h"
-#include "memfilemapper.h"
#include "locationreadplanner.h"
#include "uniqueslotgenerator.h"
-#include "simplememfileiobuffer.h"
#include <vespa/memfilepersistence/common/exceptions.h>
#include <vespa/memfilepersistence/spi/memfilepersistenceprovidermetrics.h>
-#include <vespa/vespalib/util/crc.h>
#include <vespa/vespalib/stllike/asciistream.h>
-#include <vespa/log/log.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.memfilev1");
namespace storage {
@@ -742,19 +739,16 @@ namespace {
_buffer.resize(firstAligned - _headerBlockIndex);
}
- virtual uint32_t getCachedAmount() const override
- { return _buffer.size() + _headerBlockIndex; }
-
- virtual char* getCache(uint32_t pos) override {
+ uint32_t getCachedAmount() const override { return _buffer.size() + _headerBlockIndex; }
+ char* getCache(uint32_t pos) override {
// We should never get requests to write prior to header block
// index.
assert(pos >= _headerBlockIndex);
return (&_buffer[0] + (pos - _headerBlockIndex));
}
- virtual bool duplicateCacheWrite() const override { return true; }
-
- virtual void setData(const char* data, size_t len, uint64_t pos) override {
+ bool duplicateCacheWrite() const override { return true; }
+ void setData(const char* data, size_t len, uint64_t pos) override {
if (pos < _headerBlockIndex) {
if (len <= _headerBlockIndex - pos) return;
uint32_t diff = (_headerBlockIndex - pos);
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/memfile_v1_serializer.h b/memfilepersistence/src/vespa/memfilepersistence/mapper/memfile_v1_serializer.h
index 283ab174895..500c47e94e4 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/memfile_v1_serializer.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/memfile_v1_serializer.h
@@ -1,10 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/memfilepersistence/mapper/bufferedfilewriter.h>
-#include <vespa/memfilepersistence/mapper/versionserializer.h>
-#include <vespa/memfilepersistence/mapper/fileinfo.h>
-#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h>
+#include "bufferedfilewriter.h"
+#include "versionserializer.h"
+#include "fileinfo.h"
+#include "simplememfileiobuffer.h"
#include <vespa/memfilepersistence/common/environment.h>
#include <vespa/memfilepersistence/spi/threadmetricprovider.h>
@@ -22,40 +22,25 @@ public:
MemFileV1Serializer(ThreadMetricProvider&);
- virtual FileVersion getFileVersion() override { return TRADITIONAL_SLOTFILE; }
+ FileVersion getFileVersion() override { return TRADITIONAL_SLOTFILE; }
+ void loadFile(MemFile& file, Environment&, Buffer& buffer, uint64_t bytesRead) override;
- virtual void loadFile(MemFile& file, Environment&,
- Buffer& buffer, uint64_t bytesRead) override;
-
- void cacheLocationsForPart(SimpleMemFileIOBuffer& cache,
- DocumentPart part,
- uint32_t blockIndex,
+ void cacheLocationsForPart(SimpleMemFileIOBuffer& cache, DocumentPart part, uint32_t blockIndex,
const std::vector<DataLocation>& locationsToCache,
const std::vector<DataLocation>& locationsRead,
SimpleMemFileIOBuffer::BufferAllocation& buf);
- virtual void cacheLocations(MemFileIOInterface& cache,
- Environment& env,
- const Options& options,
- DocumentPart part,
- const std::vector<DataLocation>& locations) override;
-
- virtual FlushResult flushUpdatesToFile(MemFile&, Environment&) override;
-
- virtual void rewriteFile(MemFile&, Environment&) override;
+ void cacheLocations(MemFileIOInterface& cache, Environment& env, const Options& options,
+ DocumentPart part, const std::vector<DataLocation>& locations) override;
- virtual bool verify(MemFile&, Environment&,
- std::ostream& errorReport, bool repairErrors,
- uint16_t fileVerifyFlags) override;
-
- uint64_t read(vespalib::LazyFile& file,
- char* buf,
- const std::vector<DataLocation>& readOps);
+ FlushResult flushUpdatesToFile(MemFile&, Environment&) override;
+ void rewriteFile(MemFile&, Environment&) override;
+ bool verify(MemFile&, Environment&, std::ostream& errorReport,
+ bool repairErrors, uint16_t fileVerifyFlags) override;
+ uint64_t read(vespalib::LazyFile& file, char* buf, const std::vector<DataLocation>& readOps);
void ensureFormatSpecificDataSet(const MemFile& file);
-
- uint32_t writeMetaData(BufferedFileWriter& writer,
- const MemFile& file);
+ uint32_t writeMetaData(BufferedFileWriter& writer, const MemFile& file);
uint32_t writeAndUpdateLocations(
MemFile& file,
@@ -68,4 +53,3 @@ public:
} // memfile
} // storage
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/memfilemapper.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/memfilemapper.cpp
index 90b261ceccc..4888154d3bb 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/memfilemapper.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/memfilemapper.cpp
@@ -1,15 +1,13 @@
// 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/memfilepersistence/mapper/memfilemapper.h>
-#include <vespa/log/log.h>
-#include <vespa/memfilepersistence/common/exceptions.h>
-#include <vespa/memfilepersistence/mapper/memfile_v1_serializer.h>
-#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h>
+#include "memfilemapper.h"
+#include "memfile_v1_serializer.h"
#include <vespa/memfilepersistence/spi/memfilepersistenceprovidermetrics.h>
+#include <vespa/memfilepersistence/common/exceptions.h>
#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.memfile.mapper");
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/memfilemapper.h b/memfilepersistence/src/vespa/memfilepersistence/mapper/memfilemapper.h
index b82bc59b732..3777e53cdc3 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/memfilemapper.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/memfilemapper.h
@@ -17,7 +17,7 @@
#pragma once
-#include <vespa/memfilepersistence/mapper/versionserializer.h>
+#include "versionserializer.h"
#include <vespa/memfilepersistence/spi/threadmetricprovider.h>
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.h b/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.h
index 6ed529e6c80..74875d3ee79 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.h
@@ -199,8 +199,7 @@ public:
class PartNotCachedException : public vespalib::Exception {
public:
- PartNotCachedException(const std::string& msg,
- const std::string& location)
+ PartNotCachedException(const std::string& msg, const std::string& location)
: vespalib::Exception(msg, location) {};
};
@@ -211,64 +210,39 @@ public:
const FileSpecification& fileSpec,
const Environment& env);
- virtual Document::UP getDocumentHeader(
- const document::DocumentTypeRepo& repo,
- DataLocation loc) const override;
-
- virtual document::DocumentId getDocumentId(DataLocation loc) const override;
-
- virtual void readBody(
- const document::DocumentTypeRepo& repo,
- DataLocation loc,
- Document& doc) const override;
-
- virtual DataLocation addDocumentIdOnlyHeader(
- const DocumentId& id,
- const document::DocumentTypeRepo& repo) override;
-
- virtual DataLocation addHeader(const Document& doc) override;
-
- virtual DataLocation addBody(const Document& doc) override;
-
- virtual void clear(DocumentPart type) override;
-
- virtual bool verifyConsistent() const override;
+ Document::UP getDocumentHeader(const document::DocumentTypeRepo& repo, DataLocation loc) const override;
+ document::DocumentId getDocumentId(DataLocation loc) const override;
+ void readBody(const document::DocumentTypeRepo& repo, DataLocation loc, Document& doc) const override;
+ DataLocation addDocumentIdOnlyHeader(const DocumentId& id, const document::DocumentTypeRepo& repo) override;
+ DataLocation addHeader(const Document& doc) override;
+ DataLocation addBody(const Document& doc) override;
+ void clear(DocumentPart type) override;
+ bool verifyConsistent() const override;
/**
* Moves the underlying file to another location.
*/
- virtual void move(const FileSpecification& target) override;
-
- virtual void close() override;
-
- virtual DataLocation copyCache(const MemFileIOInterface& source,
- DocumentPart part,
- DataLocation loc) override;
+ void move(const FileSpecification& target) override;
+ void close() override;
+ DataLocation copyCache(const MemFileIOInterface& source, DocumentPart part, DataLocation loc) override;
/**
* Add a location -> buffer mapping
*/
- void cacheLocation(DocumentPart part,
- DataLocation loc,
- BufferType::SP buf,
- uint32_t bufferPos);
+ void cacheLocation(DocumentPart part, DataLocation loc, BufferType::SP buf, uint32_t bufferPos);
/**
* @return Returns true if the given location is cached.
*/
- virtual bool isCached(DataLocation loc, DocumentPart type) const override;
+ bool isCached(DataLocation loc, DocumentPart type) const override;
/**
* @return Returns true if the given location has been persisted to disk.
*/
- virtual bool isPersisted(DataLocation loc, DocumentPart type) const override;
- virtual uint32_t getSerializedSize(DocumentPart part,
- DataLocation loc) const override;
-
- virtual void ensureCached(Environment& env,
- DocumentPart part,
- const std::vector<DataLocation>& locations) override;
+ bool isPersisted(DataLocation loc, DocumentPart type) const override;
+ uint32_t getSerializedSize(DocumentPart part, DataLocation loc) const override;
+ void ensureCached(Environment& env, DocumentPart part, const std::vector<DataLocation>& locations) override;
/**
* Moves the given location into the persisted data area.
@@ -342,14 +316,9 @@ private:
// the reasoning about a given bucket in the face of such actions.
std::shared_ptr<const Options> _options;
- DataLocation addLocation(DocumentPart part,
- BufferAllocation newData);
-
+ DataLocation addLocation(DocumentPart part, BufferAllocation newData);
const Data& getData(DocumentPart part, DataLocation loc) const;
-
- BufferAllocation serializeDocumentIdOnlyHeader(
- const DocumentId& id,
- const document::DocumentTypeRepo&);
+ BufferAllocation serializeDocumentIdOnlyHeader(const DocumentId& id, const document::DocumentTypeRepo&);
BufferAllocation serializeHeader(const Document& doc);
BufferAllocation serializeBody(const Document& doc);
@@ -358,5 +327,3 @@ private:
}
}
-
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/slotreadplanner.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/slotreadplanner.cpp
index fecdfb1b1c8..3690af174cf 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/slotreadplanner.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/slotreadplanner.cpp
@@ -1,8 +1,6 @@
// 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 <storage/persistence/memfile/mapper/slotreadplanner.h>
-
+#include "slotreadplanner.h"
#include <storage/persistence/memfile/memfile/memslot.h>
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/uniqueslotgenerator.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/uniqueslotgenerator.cpp
index 52408067977..eb9b09704c4 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/uniqueslotgenerator.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/uniqueslotgenerator.cpp
@@ -1,8 +1,8 @@
// 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/memfilepersistence/mapper/uniqueslotgenerator.h>
+
+#include "uniqueslotgenerator.h"
#include <vespa/memfilepersistence/memfile/memfile.h>
-#include <memfilepersistence/memfile/doccache.h>
+#include <vespa/memfilepersistence/memfile/doccache.h>
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/versionserializer.h b/memfilepersistence/src/vespa/memfilepersistence/mapper/versionserializer.h
index 7cc45451126..584351a9f72 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/versionserializer.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/versionserializer.h
@@ -11,11 +11,12 @@
#pragma once
-#include <vespa/memfilepersistence/common/types.h>
-#include <vespa/memfilepersistence/mapper/buffer.h>
-#include <vespa/memfilepersistence/mapper/mapperslotoperation.h>
+#include "buffer.h"
+#include "mapperslotoperation.h"
#include <vespa/memfilepersistence/memfile/memfile.h>
#include <vespa/memfilepersistence/memfile/memfileiointerface.h>
+#include <vespa/memfilepersistence/common/types.h>
+
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.h b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.h
index b3ac15ed376..f22035faf04 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.h
@@ -27,12 +27,12 @@
#pragma once
+#include "memslot.h"
+#include "slotiterator.h"
+#include "memfileiointerface.h"
#include <vespa/memfilepersistence/common/filespecification.h>
#include <vespa/memfilepersistence/common/types.h>
-#include <vespa/memfilepersistence/memfile/memslot.h>
-#include <vespa/memfilepersistence/memfile/slotiterator.h>
#include <vespa/vespalib/io/fileutil.h>
-#include <vespa/memfilepersistence/memfile/memfileiointerface.h>
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfilecache.cpp b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfilecache.cpp
index 8ea60d57f80..e8fff0facd0 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfilecache.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfilecache.cpp
@@ -1,19 +1,16 @@
// 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 "memfilecache.h"
#include <vespa/memfilepersistence/common/environment.h>
#include <vespa/memfilepersistence/mapper/memfilemapper.h>
-#include <vespa/memfilepersistence/memfile/memfilecache.h>
-#include <vespa/log/log.h>
-#include <vespa/vespalib/util/vstringfmt.h>
#include <vespa/memfilepersistence/spi/memfilepersistenceprovidermetrics.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.memfile.cache");
namespace storage {
namespace memfile {
-
void
MemFileCache::Entry::setInUse(bool inUse) {
LOG(debug, "Setting in use to %d for file %s", inUse, _file.toString().c_str());
@@ -111,7 +108,7 @@ struct MemFileCache::CacheEntryGuard : public MemFilePtr::EntryGuard {
_entry(&entry)
{
}
- virtual ~CacheEntryGuard() {
+ ~CacheEntryGuard() {
if (_entry) {
_cache.done(*_entry);
}
@@ -121,20 +118,20 @@ struct MemFileCache::CacheEntryGuard : public MemFilePtr::EntryGuard {
return _entry->_file;
}
- virtual void deleteFile() override {
+ void deleteFile() override {
LOG(debug, "Cache entry guard deleting %s", _file->toString().c_str());
_env._memFileMapper.deleteFile(*_file, _env);
erase();
}
- virtual void erase() override {
+ void erase() override {
LOG(debug, "Cache entry guard erasing %s from cache",
_file->toString().c_str());
_cache.erase(document::BucketId(_entry->_file.getFile().getBucketId()));
_entry = 0;
}
- virtual void move(EntryGuard& target) override {
+ void move(EntryGuard& target) override {
LOG(debug, "Cache entry guard moving %s", _file->toString().c_str());
_cache.move(*this, static_cast<CacheEntryGuard&>(target));
}
@@ -175,10 +172,7 @@ MemFileCache::setCacheSize(MemoryUsage cacheSize)
vespalib::LockGuard lock(_cacheLock);
_cacheLimit = cacheSize;
-
- _memoryToken->resize(std::min(_memoryToken->getSize(), _cacheLimit.sum()),
- _cacheLimit.sum());
-
+ _memoryToken->resize(std::min(_memoryToken->getSize(), _cacheLimit.sum()), _cacheLimit.sum());
evictWhileFull();
}
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfileptr.h b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfileptr.h
index 32d86bd415c..3856069d477 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfileptr.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfileptr.h
@@ -18,6 +18,8 @@
#pragma once
+#include <memory>
+
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.cpp b/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.cpp
index 398ca65ac19..ffcaa18218e 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.cpp
@@ -1,7 +1,6 @@
// 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/memfilepersistence/memfile/memslot.h>
+#include "memslot.h"
#include <iostream>
#include <iomanip>
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/shared_data_location_tracker.cpp b/memfilepersistence/src/vespa/memfilepersistence/memfile/shared_data_location_tracker.cpp
index 82ac8ac62d2..a4ef19c1895 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/shared_data_location_tracker.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/shared_data_location_tracker.cpp
@@ -1,6 +1,6 @@
// 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/memfilepersistence/memfile/shared_data_location_tracker.h>
+
+#include "shared_data_location_tracker.h"
namespace storage {
namespace memfile {
@@ -19,4 +19,3 @@ SharedDataLocationTracker::getOrCreateSharedLocation(
} // memfile
} // storage
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/slotiterator.h b/memfilepersistence/src/vespa/memfilepersistence/memfile/slotiterator.h
index b1d68591b92..91106cd765b 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/slotiterator.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/slotiterator.h
@@ -65,8 +65,8 @@ public:
Timestamp fromTimestamp,
Timestamp toTimestamp);
- virtual void iterate() const override;
- virtual SlotIterator* clone() const override;
+ void iterate() const override;
+ SlotIterator* clone() const override;
};
class AllSlotsIterator : public SlotIterator {
@@ -82,8 +82,8 @@ public:
Timestamp fromTimestamp,
Timestamp toTimestamp);
- virtual void iterate() const override;
- virtual SlotIterator* clone() const override;
+ void iterate() const override;
+ SlotIterator* clone() const override;
};
/**
@@ -127,4 +127,3 @@ public:
} // memfile
} // storage
-
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/cacheevictionguard.cpp b/memfilepersistence/src/vespa/memfilepersistence/spi/cacheevictionguard.cpp
index ba9bc8669c6..bf5b2f4f509 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/cacheevictionguard.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/cacheevictionguard.cpp
@@ -1,9 +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>
-#include <vespa/memfilepersistence/spi/cacheevictionguard.h>
+
+#include "cacheevictionguard.h"
#include <vespa/memfilepersistence/memfile/memfile.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.memfile.cacheevictionguard");
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/cacheevictionguard.h b/memfilepersistence/src/vespa/memfilepersistence/spi/cacheevictionguard.h
index 6df524a1c58..fe926241a42 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/cacheevictionguard.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/cacheevictionguard.h
@@ -2,6 +2,7 @@
#pragma once
#include <vespa/memfilepersistence/memfile/memfileptr.h>
+#include <cassert>
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/iteratorhandler.cpp b/memfilepersistence/src/vespa/memfilepersistence/spi/iteratorhandler.cpp
index 7a733e8cc1b..a6b5b5bd782 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/iteratorhandler.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/iteratorhandler.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 <iterator>
-#include <vespa/document/fieldset/fieldsets.h>
+
+#include "iteratorhandler.h"
+#include "visitorslotmatcher.h"
+#include "cacheevictionguard.h"
#include <vespa/document/select/bodyfielddetector.h>
-#include <vespa/document/select/node.h>
-#include <vespa/memfilepersistence/spi/iteratorhandler.h>
-#include <vespa/memfilepersistence/spi/visitorslotmatcher.h>
-#include <vespa/memfilepersistence/spi/cacheevictionguard.h>
#include <vespa/log/log.h>
LOG_SETUP(".persistence.memfile.handler.iterator");
@@ -26,14 +23,28 @@ CachePrefetchRequirements::createFromSelection(const document::DocumentTypeRepo&
return ret;
}
+
+IteratorState::IteratorState(const spi::Bucket& bucket, const spi::Selection& sel, document::FieldSet::UP fieldSet,
+ spi::IncludedVersions versions, std::unique_ptr<document::select::Node> docSel,
+ const CachePrefetchRequirements& prefetchRequirements)
+ : _bucket(bucket),
+ _selection(sel),
+ _fieldSet(std::move(fieldSet)),
+ _documentSelection(std::move(docSel)),
+ _remaining(),
+ _versions(versions),
+ _prefetchRequirements(prefetchRequirements),
+ _isActive(false),
+ _isCompleted(false)
+{}
+
+IteratorState::~IteratorState() {}
+
IteratorHandler::IteratorHandler(Environment& env)
: OperationHandler(env)
-{
-}
+{}
-IteratorHandler::~IteratorHandler()
-{
-}
+IteratorHandler::~IteratorHandler() {}
void
IteratorHandler::sanityCheckActiveIteratorCount()
@@ -91,13 +102,8 @@ IteratorHandler::createIterator(const spi::Bucket& bucket,
_sharedState._iterators.insert(
IteratorStateMap::value_type(
id,
- IteratorState(
- bucket,
- sel,
- document::FieldSet::UP(fields.clone()),
- versions,
- std::move(docSelection),
- prefetcher))));
+ IteratorState(bucket, sel, document::FieldSet::UP(fields.clone()),
+ versions, std::move(docSelection), prefetcher))));
assert(inserted.second); // Should never have duplicates
++_sharedState._nextId;
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/iteratorhandler.h b/memfilepersistence/src/vespa/memfilepersistence/spi/iteratorhandler.h
index 4e15ef5d137..97f2d97ab34 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/iteratorhandler.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/iteratorhandler.h
@@ -7,11 +7,11 @@
*/
#pragma once
-#include <map>
-#include <vespa/memfilepersistence/spi/operationhandler.h>
+#include "operationhandler.h"
#include <vespa/persistence/spi/persistenceprovider.h>
#include <vespa/document/fieldset/fieldsetrepo.h>
#include <vespa/document/select/node.h>
+#include <map>
namespace document {
@@ -83,22 +83,12 @@ class IteratorState
std::map<std::string, bool> _headerOnlyForDocumentType;
public:
- IteratorState(const spi::Bucket& bucket,
- const spi::Selection& sel,
- document::FieldSet::UP fieldSet,
- spi::IncludedVersions versions,
- std::unique_ptr<document::select::Node> docSel,
- const CachePrefetchRequirements& prefetchRequirements)
- : _bucket(bucket),
- _selection(sel),
- _fieldSet(std::move(fieldSet)),
- _documentSelection(std::move(docSel)),
- _remaining(),
- _versions(versions),
- _prefetchRequirements(prefetchRequirements),
- _isActive(false),
- _isCompleted(false)
- {}
+ IteratorState(const spi::Bucket& bucket, const spi::Selection& sel, document::FieldSet::UP fieldSet,
+ spi::IncludedVersions versions, std::unique_ptr<document::select::Node> docSel,
+ const CachePrefetchRequirements& prefetchRequirements);
+ IteratorState(IteratorState &&) = default;
+ IteratorState & operator = (IteratorState &&) = default;
+ ~IteratorState();
const spi::Bucket& getBucket() const { return _bucket; }
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/joinoperationhandler.cpp b/memfilepersistence/src/vespa/memfilepersistence/spi/joinoperationhandler.cpp
index 449e3dedf85..1f82ffb2172 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/joinoperationhandler.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/joinoperationhandler.cpp
@@ -1,10 +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 <vespa/memfilepersistence/spi/joinoperationhandler.h>
-#include <vespa/memfilepersistence/spi/cacheevictionguard.h>
+
+#include "joinoperationhandler.h"
+#include "cacheevictionguard.h"
#include <vespa/memfilepersistence/mapper/memfilemapper.h>
-#include <vespa/log/log.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.memfile.handler.join");
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/memfilepersistence.cpp b/memfilepersistence/src/vespa/memfilepersistence/spi/memfilepersistence.cpp
index c369ee47391..e210864d739 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/memfilepersistence.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/memfilepersistence.cpp
@@ -1,7 +1,6 @@
// 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/memfilepersistence/spi/memfilepersistence.h>
+#include "memfilepersistence.h"
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/operationhandler.h b/memfilepersistence/src/vespa/memfilepersistence/spi/operationhandler.h
index a55b2413321..f985f2e29d6 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/operationhandler.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/operationhandler.h
@@ -10,14 +10,14 @@
*/
#pragma once
-#include <vespa/memfilepersistence/common/filespecification.h>
-#include <vespa/memfilepersistence/common/types.h>
#include <vespa/memfilepersistence/memfile/memfile.h>
#include <vespa/memfilepersistence/memfile/memfilecache.h>
#include <vespa/memfilepersistence/memfile/memfileptr.h>
+#include <vespa/memfilepersistence/common/environment.h>
+#include <vespa/memfilepersistence/common/filespecification.h>
#include <vespa/memfilepersistence/common/slotmatcher.h>
+#include <vespa/memfilepersistence/common/types.h>
#include <vespa/persistence/spi/bucketinfo.h>
-#include <vespa/memfilepersistence/common/environment.h>
#include <vespa/document/fieldset/fieldsetrepo.h>
namespace document {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/splitoperationhandler.cpp b/memfilepersistence/src/vespa/memfilepersistence/spi/splitoperationhandler.cpp
index 247722588f5..9e75e4fa182 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/splitoperationhandler.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/splitoperationhandler.cpp
@@ -1,9 +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/memfilepersistence/spi/splitoperationhandler.h>
-#include <vespa/memfilepersistence/spi/cacheevictionguard.h>
-#include <vespa/log/log.h>
+#include "splitoperationhandler.h"
+#include "cacheevictionguard.h"
+
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.memfile.handler.split");
namespace storage {
@@ -25,7 +25,7 @@ struct BucketMatcher : public SlotMatcher {
_factory(factory),
_bid(bid) {}
- virtual bool match(const Slot& slot) override {
+ bool match(const Slot& slot) override {
document::DocumentId id(slot.getDocumentId());
document::BucketId bucket = _factory.getBucketId(id);
bucket.setUsedBits(_bid.getUsedBits());
@@ -69,7 +69,7 @@ SplitOperationHandler::splitIntoFile(MemFile& source,
MemFileCacheEvictionGuard targetFile(getMemFile(target, false));
LOG(debug,
- "Found %" PRIu64 " slots to move from file %s to file %s",
+ "Found %zu slots to move from file %s to file %s",
ts.size(),
source.getFile().toString().c_str(),
targetFile->getFile().toString().c_str());
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/threadlocals.cpp b/memfilepersistence/src/vespa/memfilepersistence/spi/threadlocals.cpp
index b6c71165f28..3b87d1bf1f3 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/threadlocals.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/threadlocals.cpp
@@ -1,6 +1,6 @@
// 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/memfilepersistence/spi/threadlocals.h>
+
+#include "threadlocals.h"
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/threadlocals.h b/memfilepersistence/src/vespa/memfilepersistence/spi/threadlocals.h
index 518eec7f909..20e12974061 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/threadlocals.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/threadlocals.h
@@ -2,6 +2,7 @@
#pragma once
#include <vespa/vespalib/util/sync.h>
+#include <vector>
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/visitorslotmatcher.cpp b/memfilepersistence/src/vespa/memfilepersistence/spi/visitorslotmatcher.cpp
index d5b3927018c..a3e5567290e 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/visitorslotmatcher.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/visitorslotmatcher.cpp
@@ -1,6 +1,6 @@
// 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/memfilepersistence/spi/visitorslotmatcher.h>
+
+#include "visitorslotmatcher.h"
#include <vespa/document/select/bodyfielddetector.h>
#include <vespa/document/select/node.h>
@@ -46,7 +46,7 @@ VisitorSlotMatcher::VisitorSlotMatcher(
_selection(selection),
_needDocument(needDocument(selection))
{
-};
+}
bool
VisitorSlotMatcher::match(const Slot& slot) {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/spi/visitorslotmatcher.h b/memfilepersistence/src/vespa/memfilepersistence/spi/visitorslotmatcher.h
index cc85716eecc..20d9378da9f 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/spi/visitorslotmatcher.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/spi/visitorslotmatcher.h
@@ -2,6 +2,7 @@
#pragma once
#include <vespa/memfilepersistence/common/slotmatcher.h>
+
namespace document {
namespace select {
class Node;
@@ -21,7 +22,7 @@ public:
VisitorSlotMatcher(const document::DocumentTypeRepo& repo,
const document::select::Node* selection);
- virtual bool match(const Slot& slot);
+ bool match(const Slot& slot) override;
};
diff --git a/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfile.cpp b/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfile.cpp
index c794d611767..072b3e9fae0 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfile.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfile.cpp
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
+#include "dumpslotfile.h"
#include <vespa/config/helper/configgetter.h>
#include <vespa/document/config/config-documenttypes.h>
#include <vespa/document/repo/documenttyperepo.h>
@@ -9,7 +9,6 @@
#include <vespa/memfilepersistence/mapper/memfilemapper.h>
#include <vespa/memfilepersistence/memfile/memfilecache.h>
#include <vespa/memfilepersistence/spi/memfilepersistenceprovidermetrics.h>
-#include <vespa/memfilepersistence/tools/dumpslotfile.h>
#include <vespa/storageframework/defaultimplementation/clock/realclock.h>
#include <vespa/storageframework/defaultimplementation/component/componentregisterimpl.h>
#include <vespa/storageframework/defaultimplementation/memory/nomemorymanager.h>
diff --git a/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfileapp.cpp b/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfileapp.cpp
index f8d13714ae9..544be9c5eac 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfileapp.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfileapp.cpp
@@ -1,8 +1,8 @@
// 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 "dumpslotfile.h"
#include <vespa/config/subscription/configuri.h>
-#include <vespa/memfilepersistence/tools/dumpslotfile.h>
+#include <vespa/fastos/app.h>
#include <iostream>
namespace {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/tools/vdsdiskapp.cpp b/memfilepersistence/src/vespa/memfilepersistence/tools/vdsdiskapp.cpp
index 7127c75cb1b..34855aeabc1 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/tools/vdsdiskapp.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/tools/vdsdiskapp.cpp
@@ -1,13 +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 "vdsdisktool.h"
#include <vespa/defaults.h>
-#include <vespa/log/log.h>
-#include <vespa/memfilepersistence/tools/vdsdisktool.h>
+#include <vespa/fastos/app.h>
#include <iostream>
-LOG_SETUP(".vdsdisktool");
-
namespace {
struct DiskApp : public FastOS_Application {
int Main() override {