blob: 9238f0cb7f0281a0effb4285d65aac5b2703e60d (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/storageapi/message/bucket.h>
namespace storage {
/*
* Class for remapping bit masks from a partial set of nodes to a full
* set of nodes.
*/
class HasMaskRemapper
{
std::vector<uint16_t> _mask_remap;
uint16_t _all_remapped;
public:
HasMaskRemapper(const std::vector<api::MergeBucketCommand::Node> &all_nodes,
const std::vector<api::MergeBucketCommand::Node> &nodes);
~HasMaskRemapper();
uint16_t operator()(uint16_t mask) const;
uint16_t operator()(uint16_t mask, uint16_t keep_from_full_mask) const;
};
}
|