OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::TypedParquetStorageBuffer< Type > Class Template Reference

#include <TypedParquetStorageBuffer.h>

+ Inheritance diagram for foreign_storage::TypedParquetStorageBuffer< Type >:
+ Collaboration diagram for foreign_storage::TypedParquetStorageBuffer< Type >:

Public Member Functions

 TypedParquetStorageBuffer ()
 
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
 
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 reserve (size_t additional_num_bytes) override
 
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 reserveNumElements (size_t additional_num_elements)
 
void appendElement (const Type &element)
 
std::vector< Type > * getBufferPtr ()
 
int8_t * getMemoryPtr () override
 
size_t pageCount () const override
 
size_t pageSize () const override
 
size_t reservedSize () const override
 
Data_Namespace::MemoryLevel getType () const override
 
template<typename FindContainer >
void eraseInvalidData (const FindContainer &invalid_indices)
 
- Public Member Functions inherited from Data_Namespace::AbstractBuffer
 AbstractBuffer (const int device_id)
 
 AbstractBuffer (const int device_id, const SQLTypeInfo sql_type)
 
virtual ~AbstractBuffer ()
 
virtual void setMemoryPtr (int8_t *new_ptr)
 
virtual int pin ()
 
virtual int unPin ()
 
virtual int getPinCount ()
 
size_t size () const
 
int getDeviceId () const
 
bool isDirty () const
 
bool isAppended () const
 
bool isUpdated () const
 
bool hasEncoder () const
 
SQLTypeInfo getSqlType () const
 
void setSqlType (const SQLTypeInfo &sql_type)
 
EncodergetEncoder () const
 
void setDirty ()
 
void setUpdated ()
 
void setAppended ()
 
void setSize (const size_t size)
 
void clearDirtyBits ()
 
void initEncoder (const SQLTypeInfo &tmp_sql_type)
 
void syncEncoder (const AbstractBuffer *src_buffer)
 
void copyTo (AbstractBuffer *destination_buffer, const size_t num_bytes=0)
 
void resetToEmpty ()
 

Private Attributes

std::vector< Typebuffer_
 

Additional Inherited Members

- Protected Attributes inherited from Data_Namespace::AbstractBuffer
std::unique_ptr< Encoderencoder_
 
SQLTypeInfo sql_type_
 
size_t size_
 
int device_id_
 

Detailed Description

template<typename Type>
class foreign_storage::TypedParquetStorageBuffer< Type >

Definition at line 27 of file TypedParquetStorageBuffer.h.

Constructor & Destructor Documentation

Definition at line 21 of file TypedParquetStorageBuffer.cpp.

21 : AbstractBuffer(0) {}
AbstractBuffer(const int device_id)

Member Function Documentation

template<typename Type >
void foreign_storage::TypedParquetStorageBuffer< Type >::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 
)
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 39 of file TypedParquetStorageBuffer.cpp.

References UNREACHABLE.

43  {
44  UNREACHABLE();
45 }
#define UNREACHABLE()
Definition: Logger.h:253
template<typename Type>
void foreign_storage::TypedParquetStorageBuffer< Type >::appendElement ( const Type element)

Definition at line 93 of file TypedParquetStorageBuffer.cpp.

Referenced by foreign_storage::ParquetGeospatialImportEncoder::appendArrayDatumsIfApplicable(), foreign_storage::ParquetGeospatialImportEncoder::appendBaseAndRenderGroupData(), foreign_storage::ParquetStringImportEncoder::appendData(), and foreign_storage::ParquetArrayImportEncoder::appendToArrayDatumBuffer().

93  {
94  buffer_.push_back(element);
95 }

+ Here is the caller graph for this function:

template<typename Type>
template<typename FindContainer >
void foreign_storage::TypedParquetStorageBuffer< Type >::eraseInvalidData ( const FindContainer &  invalid_indices)
inline

Definition at line 65 of file TypedParquetStorageBuffer.h.

Referenced by foreign_storage::ParquetStringImportEncoder::eraseInvalidIndicesInBuffer(), foreign_storage::ParquetGeospatialImportEncoder::eraseInvalidIndicesInBuffer(), and foreign_storage::ParquetArrayImportEncoder::eraseInvalidIndicesInBuffer().

65  {
66  if (invalid_indices.empty()) {
67  return;
68  }
69  auto end_it = std::remove_if(buffer_.begin(), buffer_.end(), [&](const Type& value) {
70  const Type* start = buffer_.data();
71  auto index = std::distance(start, &value);
72  return invalid_indices.find(index) != invalid_indices.end();
73  });
74  buffer_.erase(end_it, buffer_.end());
75  }

+ Here is the caller graph for this function:

template<typename Type >
std::vector< Type > * foreign_storage::TypedParquetStorageBuffer< Type >::getBufferPtr ( )

Definition at line 98 of file TypedParquetStorageBuffer.cpp.

98  {
99  return &buffer_;
100 }
template<typename Type >
int8_t * foreign_storage::TypedParquetStorageBuffer< Type >::getMemoryPtr ( )
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 48 of file TypedParquetStorageBuffer.cpp.

References UNREACHABLE.

48  {
49  UNREACHABLE();
50  return {};
51 }
#define UNREACHABLE()
Definition: Logger.h:253
template<typename Type >
Data_Namespace::MemoryLevel foreign_storage::TypedParquetStorageBuffer< Type >::getType ( ) const
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 60 of file TypedParquetStorageBuffer.cpp.

References Data_Namespace::CPU_LEVEL, and UNREACHABLE.

60  {
61  UNREACHABLE();
63 }
#define UNREACHABLE()
Definition: Logger.h:253
template<typename Type >
size_t foreign_storage::TypedParquetStorageBuffer< Type >::pageCount ( ) const
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 76 of file TypedParquetStorageBuffer.cpp.

References UNREACHABLE.

76  {
77  UNREACHABLE();
78  return 0; // Added to avoid "no return statement" compiler warning
79 }
#define UNREACHABLE()
Definition: Logger.h:253
template<typename Type >
size_t foreign_storage::TypedParquetStorageBuffer< Type >::pageSize ( ) const
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 82 of file TypedParquetStorageBuffer.cpp.

References UNREACHABLE.

82  {
83  UNREACHABLE();
84  return 0; // Added to avoid "no return statement" compiler warning
85 }
#define UNREACHABLE()
Definition: Logger.h:253
template<typename Type >
void foreign_storage::TypedParquetStorageBuffer< Type >::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 
)
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 24 of file TypedParquetStorageBuffer.cpp.

References UNREACHABLE.

29  {
30  UNREACHABLE();
31 }
#define UNREACHABLE()
Definition: Logger.h:253
template<typename Type >
void foreign_storage::TypedParquetStorageBuffer< Type >::reserve ( size_t  additional_num_bytes)
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 34 of file TypedParquetStorageBuffer.cpp.

References UNREACHABLE.

34  {
35  UNREACHABLE();
36 }
#define UNREACHABLE()
Definition: Logger.h:253
template<typename Type >
size_t foreign_storage::TypedParquetStorageBuffer< Type >::reservedSize ( ) const
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 54 of file TypedParquetStorageBuffer.cpp.

References UNREACHABLE.

54  {
55  UNREACHABLE();
56  return 0;
57 }
#define UNREACHABLE()
Definition: Logger.h:253
template<typename Type >
void foreign_storage::TypedParquetStorageBuffer< Type >::reserveNumElements ( size_t  additional_num_elements)

Definition at line 88 of file TypedParquetStorageBuffer.cpp.

Referenced by foreign_storage::ParquetStringImportEncoder::appendData().

88  {
89  buffer_.reserve(buffer_.size() + additional_num_elements);
90 }

+ Here is the caller graph for this function:

template<typename Type >
void foreign_storage::TypedParquetStorageBuffer< Type >::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 
)
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 66 of file TypedParquetStorageBuffer.cpp.

References UNREACHABLE.

71  {
72  UNREACHABLE();
73 }
#define UNREACHABLE()
Definition: Logger.h:253

Member Data Documentation

template<typename Type>
std::vector<Type> foreign_storage::TypedParquetStorageBuffer< Type >::buffer_
private

The documentation for this class was generated from the following files: