aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/bucketdb/bucketinfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/src/vespa/storage/bucketdb/bucketinfo.h')
-rw-r--r--storage/src/vespa/storage/bucketdb/bucketinfo.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/storage/src/vespa/storage/bucketdb/bucketinfo.h b/storage/src/vespa/storage/bucketdb/bucketinfo.h
index 219d0335966..9c024c31fd3 100644
--- a/storage/src/vespa/storage/bucketdb/bucketinfo.h
+++ b/storage/src/vespa/storage/bucketdb/bucketinfo.h
@@ -118,12 +118,23 @@ public:
std::string toString() const;
uint32_t getHighestDocumentCount() const noexcept;
- uint32_t getHighestTotalDocumentSize() const noexcept;
uint32_t getHighestMetaCount() const noexcept;
uint32_t getHighestUsedFileSize() const noexcept;
-
+ struct Highest {
+ Highest() noexcept : _documentCount(0),_totalDocumentSize(0),_metaCount(0),_usedFileSize(0) {}
+ void update(const BucketCopy & n) noexcept {
+ _documentCount = std::max(_documentCount, n.getDocumentCount());
+ _totalDocumentSize = std::max(_totalDocumentSize, n.getTotalDocumentSize());
+ _metaCount = std::max(_metaCount, n.getMetaCount());
+ _usedFileSize = std::max(_usedFileSize, n.getUsedFileSize());
+ }
+ uint32_t _documentCount;
+ uint32_t _totalDocumentSize;
+ uint32_t _metaCount;
+ uint32_t _usedFileSize;
+ };
+ Highest getHighest() const noexcept;
bool hasRecentlyCreatedEmptyCopy() const noexcept;
-
bool operator==(const BucketInfoBase& other) const noexcept;
};