summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-01-28 11:14:17 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-01-28 11:14:17 +0000
commit02854fd7ecbb93b3bba1aecea0b9ed83b4ce8545 (patch)
tree30ec1c9fdbffd17e2d726afc766cfd193cb94c27 /searchlib
parent120e5948c43eb8b30539b9ecc69f3def3bf8fed1 (diff)
Locate similar methods together and improve comment.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdatastore.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
index 36768f36036..f2c4e12488a 100644
--- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
@@ -330,23 +330,6 @@ LogDataStore::initFlush(uint64_t syncToken)
return syncToken;
}
-double
-LogDataStore::getMaxBucketSpread() const
-{
- double maxSpread(1.0);
- MonitorGuard guard(_updateLock);
- for (FileId i(0); i < FileId(_fileChunks.size()); i = i.next()) {
- /// Ignore the the active file
- if (i != _active) {
- const auto & fc = _fileChunks[i.getId()];
- if (fc && _bucketizer && fc->frozen()) {
- maxSpread = std::max(maxSpread, fc->getBucketSpread());
- }
- }
- }
- return maxSpread;
-}
-
std::pair<bool, LogDataStore::FileId>
LogDataStore::findNextToCompact(bool dueToBloat)
{
@@ -581,6 +564,22 @@ LogDataStore::getDiskHeaderFootprint() const
return sz;
}
+double
+LogDataStore::getMaxBucketSpread() const
+{
+ double maxSpread(1.0);
+ MonitorGuard guard(_updateLock);
+ for (FileId i(0); i < FileId(_fileChunks.size()); i = i.next()) {
+ /// Ignore the the active file as it is never considered for reordering until completed and frozen.
+ if (i != _active) {
+ const auto & fc = _fileChunks[i.getId()];
+ if (fc && _bucketizer && fc->frozen()) {
+ maxSpread = std::max(maxSpread, fc->getBucketSpread());
+ }
+ }
+ }
+ return maxSpread;
+}
size_t
LogDataStore::getDiskBloat() const
@@ -588,7 +587,8 @@ LogDataStore::getDiskBloat() const
MonitorGuard guard(_updateLock);
size_t sz(0);
for (FileId i(0); i < FileId(_fileChunks.size()); i = i.next()) {
- /// Do not count the holes in the last file as bloat
+ /// Do not count the holes in the last file as bloat as it is
+ /// never considered for compaction until completed and frozen.
if (i != _active) {
const auto & chunk = _fileChunks[i.getId()];
if (chunk) {