forked from manticoresoftware/manticoresearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
columnarrt.h
58 lines (46 loc) · 2.04 KB
/
columnarrt.h
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
//
// Copyright (c) 2021-2023, Manticore Software LTD (https://manticoresearch.com)
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License. You should have
// received a copy of the GPL license along with this program; if you
// did not, you can find it at http://www.gnu.org/
//
#ifndef _columnarrt_
#define _columnarrt_
#include <cstdint>
#include "sphinxdefs.h"
#include "sphinxstd.h"
#include "columnarlib.h"
#include "fileio.h"
class CSphSchema;
class ColumnarRT_i : public columnar::Columnar_i
{
public:
virtual int64_t AllocatedBytes() const = 0;
virtual void Save ( Writer_i & tWriter ) = 0;
};
class MemoryReader_c;
class MemoryWriter_c;
class ColumnarAttrRT_i;
class ColumnarBuilderRT_i : public columnar::Builder_i
{
public:
virtual void Kill ( const CSphVector<RowID_t> & dKilled ) = 0;
virtual void Save ( MemoryWriter_c & tWriter ) = 0;
virtual CSphVector<std::unique_ptr<ColumnarAttrRT_i>> & GetAttrs() = 0;
virtual const CSphVector<std::unique_ptr<ColumnarAttrRT_i>>& GetAttrs() const = 0;
};
// used in accumulator. loads whole storage (no schema to save memory)
std::unique_ptr<ColumnarBuilderRT_i> CreateColumnarBuilderRT ( MemoryReader_c& tReader );
// create an empty builder, create storage from schema
std::unique_ptr<ColumnarBuilderRT_i> CreateColumnarBuilderRT ( const CSphSchema & tSchema );
// initialize columnar from accumulator; setup schema
// columnar reader will take ownership of attributes in columnar builder (and remove them from builder)
std::unique_ptr<ColumnarRT_i> CreateColumnarRT ( const CSphSchema & tSchema, ColumnarBuilderRT_i* pBuilder );
// columnar reader will NOT take ownership of attributes in columnar builder
std::unique_ptr<ColumnarRT_i> CreateLightColumnarRT ( const CSphSchema& tSchema, const ColumnarBuilderRT_i* pBuilder );
// used by ram segments and binlog
std::unique_ptr<ColumnarRT_i> CreateColumnarRT ( const CSphSchema & tSchema, CSphReader & tReader, CSphString & sError );
#endif // _columnarrt_