aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storageapi
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-02-06 17:20:25 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-02-06 17:51:42 +0000
commitcabef01a63a222c6805521c188f24f57e9296152 (patch)
tree538485877d0f265f47a97b34419adef032fc09d3 /storage/src/vespa/storageapi
parent1a37850993a673e79182eb62220d063878d48410 (diff)
General code healt, nodiscard, range loops etc
Diffstat (limited to 'storage/src/vespa/storageapi')
-rw-r--r--storage/src/vespa/storageapi/message/bucket.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/storage/src/vespa/storageapi/message/bucket.h b/storage/src/vespa/storageapi/message/bucket.h
index 57eed20f665..801c75322b3 100644
--- a/storage/src/vespa/storageapi/message/bucket.h
+++ b/storage/src/vespa/storageapi/message/bucket.h
@@ -14,7 +14,7 @@
#include <vespa/storageapi/messageapi/maintenancecommand.h>
#include <vespa/document/base/globalid.h>
#include <vespa/document/util/printable.h>
-#include <vespa/vespalib/util/array.h>
+#include <vespa/vespalib/stllike/allocator.h>
#include <vespa/storageapi/defs.h>
namespace document { class DocumentTypeRepo; }
@@ -237,7 +237,7 @@ private:
public:
explicit GetBucketDiffReply(const GetBucketDiffCommand& cmd);
- ~GetBucketDiffReply();
+ ~GetBucketDiffReply() override;
const std::vector<Node>& getNodes() const { return _nodes; }
Timestamp getMaxTimestamp() const { return _maxTimestamp; }
@@ -268,14 +268,14 @@ public:
const document::DocumentTypeRepo *_repo;
Entry();
- Entry(const GetBucketDiffCommand::Entry&);
+ explicit Entry(const GetBucketDiffCommand::Entry&);
Entry(const Entry &);
Entry & operator = (const Entry &);
Entry(Entry &&) = default;
Entry & operator = (Entry &&) = default;
- ~Entry();
+ ~Entry() override;
- bool filled() const;
+ [[nodiscard]] bool filled() const;
void print(std::ostream& out, bool verbose, const std::string& indent) const override;
bool operator==(const Entry&) const;
};
@@ -358,7 +358,7 @@ public:
const std::vector<document::BucketId>& getBuckets() const { return _buckets; }
- bool hasSystemState() const { return (_state.get() != 0); }
+ bool hasSystemState() const { return bool(_state); }
uint16_t getDistributor() const { return _distributor; }
const lib::ClusterState& getSystemState() const { return *_state; }
@@ -387,8 +387,8 @@ public:
bool operator==(const Entry& e) const { return (_bucketId == e._bucketId && _info == e._info); }
bool operator!=(const Entry& e) const { return !(*this == e); }
- Entry() : _bucketId(), _info() {}
- Entry(const document::BucketId& id, const BucketInfo& info)
+ Entry() noexcept : _bucketId(), _info() {}
+ Entry(const document::BucketId& id, const BucketInfo& info) noexcept
: _bucketId(id), _info(info) {}
friend std::ostream& operator<<(std::ostream& os, const Entry&);
};
@@ -397,7 +397,7 @@ public:
bool two_phase_remove_location = false;
bool no_implicit_indexing_of_active_buckets = false;
};
- using EntryVector = vespalib::Array<Entry>;
+ using EntryVector = std::vector<Entry, vespalib::allocator_large<Entry>>;
private:
EntryVector _buckets;
bool _full_bucket_fetch;