diff options
author | Geir Storli <geirst@verizonmedia.com> | 2019-08-13 15:46:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-13 15:46:32 +0200 |
commit | af8053b48eff8f324e8e01dd5c9d08354c006cf0 (patch) | |
tree | a21bca6066914c135fe14a0c7501de3a386cdea0 /searchlib/src | |
parent | f638c6bf766fb2e25828c68bfb6493640b576f06 (diff) | |
parent | 5a829878b375af5f83c7fe53283acbee65587587 (diff) |
Merge pull request #10253 from vespa-engine/geirst/block-lid-space-compaction-when-deleting-buckets
Block lid space compaction job while remove batch (delete buckets) is…
Diffstat (limited to 'searchlib/src')
-rw-r--r-- | searchlib/src/vespa/searchlib/common/lid_usage_stats.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/searchlib/src/vespa/searchlib/common/lid_usage_stats.h b/searchlib/src/vespa/searchlib/common/lid_usage_stats.h index 98d2cfc7e5c..b54a3ce8a6a 100644 --- a/searchlib/src/vespa/searchlib/common/lid_usage_stats.h +++ b/searchlib/src/vespa/searchlib/common/lid_usage_stats.h @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once +#include <chrono> #include <stdint.h> namespace search { @@ -8,36 +9,43 @@ namespace search { /** * Stats on the usage and availability of lids in a document meta store. */ -class LidUsageStats -{ +class LidUsageStats { +public: + using TimePoint = std::chrono::time_point<std::chrono::steady_clock>; + private: uint32_t _lidLimit; uint32_t _usedLids; uint32_t _lowestFreeLid; uint32_t _highestUsedLid; + TimePoint _last_remove_batch; public: LidUsageStats() : _lidLimit(0), _usedLids(0), _lowestFreeLid(0), - _highestUsedLid(0) + _highestUsedLid(0), + _last_remove_batch() { } LidUsageStats(uint32_t lidLimit, uint32_t usedLids, uint32_t lowestFreeLid, - uint32_t highestUsedLid) + uint32_t highestUsedLid, + TimePoint last_remove_batch) : _lidLimit(lidLimit), _usedLids(usedLids), _lowestFreeLid(lowestFreeLid), - _highestUsedLid(highestUsedLid) + _highestUsedLid(highestUsedLid), + _last_remove_batch(last_remove_batch) { } uint32_t getLidLimit() const { return _lidLimit; } uint32_t getUsedLids() const { return _usedLids; } uint32_t getLowestFreeLid() const { return _lowestFreeLid; } uint32_t getHighestUsedLid() const { return _highestUsedLid; } + const TimePoint& get_last_remove_batch() const { return _last_remove_batch; } uint32_t getLidBloat() const { // Account for reserved lid 0 int32_t lidBloat = getLidLimit() - getUsedLids() - 1; @@ -61,5 +69,5 @@ public: } }; -} // namespace search +} |