blob: 9b315a9142de8b0391f75868c99c1551cf2f9ee4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "alloc_strategy.h"
namespace proton {
enum class SubDbType;
/*
* Class representing allocation config for proton which can be used
* to make an allocation strategy for large data structures owned by a
* document sub db (e.g. attribute vectors, document meta store).
*/
class AllocConfig
{
AllocStrategy _alloc_strategy; // baseline before adjusting for redundancy / searchable copies
const uint32_t _redundancy;
const uint32_t _searchable_copies;
public:
AllocConfig(const AllocStrategy& alloc_strategy, uint32_t redundancy, uint32_t searchable_copies);
~AllocConfig();
bool operator==(const AllocConfig &rhs) const noexcept;
bool operator!=(const AllocConfig &rhs) const noexcept {
return !operator==(rhs);
}
AllocStrategy make_alloc_strategy(SubDbType sub_db_type) const;
static AllocConfig makeDefault() { return AllocConfig(AllocStrategy(), 1, 1); }
};
}
|