aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/docstore/ibucketizer.h
blob: b7b55974978c707fc885bbc5cd3ab2df0140f428 (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/vespalib/util/generationhandler.h>
#include <vespa/vespalib/util/buffer.h>
#include <vespa/document/bucket/bucketid.h>

namespace search {

class IBucketizer
{
public:
    using SP = std::shared_ptr<IBucketizer>;
    virtual ~IBucketizer() { }
    virtual document::BucketId getBucketOf(const vespalib::GenerationHandler::Guard & guard, uint32_t lid) const = 0;
    virtual vespalib::GenerationHandler::Guard getGuard() const = 0;
};

class IBufferVisitor {
public:
    virtual ~IBufferVisitor() { }
    virtual void visit(uint32_t lid, vespalib::ConstBufferRef buffer) = 0;
};

}