aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/distributor/pending_bucket_space_db_transition_entry.h
blob: 49a23d0d0c466c062dc5621ebe1e85bb88e300dd (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/document/bucket/bucketid.h>
#include <vespa/storage/bucketdb/bucketcopy.h>

namespace storage::distributor::dbtransition {

struct Entry {
    Entry(const document::BucketId& bid,
          const BucketCopy& copy_) noexcept
        : bucket_key(bid.toKey()),
          copy(copy_)
    {}

    uint64_t bucket_key;
    BucketCopy copy;

    document::BucketId bucket_id() const noexcept {
        return document::BucketId(document::BucketId::keyToBucketId(bucket_key));
    }

    bool operator<(const Entry& other) const noexcept {
        return bucket_key < other.bucket_key;
    }
};

}