OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TypedParquetStorageBuffer.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
19 namespace foreign_storage {
20 template <typename Type>
22 
23 template <typename Type>
25  int8_t* const destination,
26  const size_t num_bytes,
27  const size_t offset,
28  const Data_Namespace::MemoryLevel destination_buffer_type,
29  const int destination_device_id) {
30  UNREACHABLE();
31 }
32 
33 template <typename Type>
34 void TypedParquetStorageBuffer<Type>::reserve(size_t additional_num_bytes) {
35  UNREACHABLE();
36 }
37 
38 template <typename Type>
40  int8_t* source,
41  const size_t num_bytes,
42  const Data_Namespace::MemoryLevel source_buffer_type,
43  const int device_id) {
44  UNREACHABLE();
45 }
46 
47 template <typename Type>
49  UNREACHABLE();
50  return {};
51 }
52 
53 template <typename Type>
55  UNREACHABLE();
56  return 0;
57 }
58 
59 template <typename Type>
61  UNREACHABLE();
63 }
64 
65 template <typename Type>
67  int8_t* source,
68  const size_t num_bytes,
69  const size_t offset,
70  const Data_Namespace::MemoryLevel source_buffer_type,
71  const int source_device_id) {
72  UNREACHABLE();
73 }
74 
75 template <typename Type>
77  UNREACHABLE();
78  return 0; // Added to avoid "no return statement" compiler warning
79 }
80 
81 template <typename Type>
83  UNREACHABLE();
84  return 0; // Added to avoid "no return statement" compiler warning
85 }
86 
87 template <typename Type>
88 void TypedParquetStorageBuffer<Type>::reserveNumElements(size_t additional_num_elements) {
89  buffer_.reserve(buffer_.size() + additional_num_elements);
90 }
91 
92 template <typename Type>
94  buffer_.push_back(element);
95 }
96 
97 template <typename Type>
99  return &buffer_;
100 }
101 
102 // Instantiate the two templates that are expected to be used
105 
106 } // namespace foreign_storage
void append(int8_t *source, const size_t num_bytes, const Data_Namespace::MemoryLevel source_buffer_type=Data_Namespace::CPU_LEVEL, const int device_id=-1) override
void read(int8_t *const destination, const size_t num_bytes, const size_t offset=0, const Data_Namespace::MemoryLevel destination_buffer_type=Data_Namespace::CPU_LEVEL, const int destination_device_id=-1) override
#define UNREACHABLE()
Definition: Logger.h:338
void reserve(size_t additional_num_bytes) override
void write(int8_t *source, const size_t num_bytes, const size_t offset=0, const Data_Namespace::MemoryLevel source_buffer_type=Data_Namespace::CPU_LEVEL, const int source_device_id=-1) override
void reserveNumElements(size_t additional_num_elements)
Data_Namespace::MemoryLevel getType() const override