aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.h
blob: a640f13888cbedc62c6f90cc7ec25b7f9d7a5302 (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 Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/searchcommon/attribute/i_attribute_functor.h>
#include <memory>

namespace proton {

class AttributeUsageSamplerContext;

/**
 * Functor for sampling attribute usage and passing it on to sampler context.
 */
class AttributeUsageSamplerFunctor : public search::attribute::IConstAttributeFunctor
{
    std::shared_ptr<AttributeUsageSamplerContext> _samplerContext;
    std::string _subDbName;
public:
    AttributeUsageSamplerFunctor(std::shared_ptr<AttributeUsageSamplerContext> samplerContext,
                                 const std::string &subDbname);
    ~AttributeUsageSamplerFunctor() override;
    void operator()(const search::attribute::IAttributeVector &attributeVector) override;
};

} // namespace proton