aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/diskindex/zcposocc.h
blob: d8507bb075d804f3483f4d83322e7c35eddd141f (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "zcposting.h"
#include <vespa/searchlib/bitcompression/posocccompression.h>
#include <vespa/searchlib/bitcompression/posocc_fields_params.h>

namespace search::diskindex {

class Zc4PosOccSeqRead : public Zc4PostingSeqRead
{
private:
    bitcompression::PosOccFieldsParams _fieldsParams;
    bitcompression::EG2PosOccDecodeContextCooked<true> _cookedDecodeContext;
    bitcompression::EG2PosOccDecodeContext<true> _rawDecodeContext;

public:
    Zc4PosOccSeqRead(index::PostingListCountFileSeqRead *countFile);
    void setFeatureParams(const PostingListParams &params) override;
    static const vespalib::string &getSubIdentifier();
    const index::FieldLengthInfo &get_field_length_info() const override;
};


class Zc4PosOccSeqWrite : public Zc4PostingSeqWrite
{
private:
    bitcompression::PosOccFieldsParams _fieldsParams;
    bitcompression::EG2PosOccEncodeContext<true> _realEncodeFeatures;

public:
    using Schema = index::Schema;

    Zc4PosOccSeqWrite(const Schema &schema, uint32_t indexId,
                      const index::FieldLengthInfo &field_length_info,
                      index::PostingListCountFileSeqWrite *countFile);
};


class ZcPosOccSeqRead : public Zc4PostingSeqRead
{
private:
    bitcompression::PosOccFieldsParams _fieldsParams;
    bitcompression::EGPosOccDecodeContextCooked<true> _cookedDecodeContext;
    bitcompression::EGPosOccDecodeContext<true> _rawDecodeContext;
public:
    ZcPosOccSeqRead(index::PostingListCountFileSeqRead *countFile);
    void setFeatureParams(const PostingListParams &params) override;
    static const vespalib::string &getSubIdentifier();
    const index::FieldLengthInfo &get_field_length_info() const override;
};


class ZcPosOccSeqWrite : public ZcPostingSeqWrite
{
private:
    bitcompression::PosOccFieldsParams _fieldsParams;
    bitcompression::EGPosOccEncodeContext<true> _realEncodeFeatures;
public:
    using Schema = index::Schema;
    ZcPosOccSeqWrite(const Schema &schema, uint32_t indexId,
                     const index::FieldLengthInfo &field_length_info,
                     index::PostingListCountFileSeqWrite *countFile);
};

}