blob: 82572df4bd23fc8760eb65722ecf3c1dfd2730c2 (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "raw_attribute.h"
#include <vespa/vespalib/stllike/allocator.h>
namespace search::attribute {
/**
* Attribute vector storing a single raw value per document in streaming search.
*/
class SingleRawExtAttribute : public RawAttribute,
public IExtendAttribute
{
std::vector<char, vespalib::allocator_large<char>> _buffer;
std::vector<uint32_t, vespalib::allocator_large<uint32_t>> _offsets;
public:
SingleRawExtAttribute(const vespalib::string& name);
~SingleRawExtAttribute() override;
void onCommit() override;
void onUpdateStat() override;
bool addDoc(DocId& docId) override;
bool add(vespalib::ConstArrayRef<char> v, int32_t) override;
vespalib::ConstArrayRef<char> get_raw(DocId docid) const override;
IExtendAttribute* getExtendInterface() override;
};
}
|