OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::TypedParquetDetectBuffer Class Reference

#include <TypedParquetDetectBuffer.h>

+ Inheritance diagram for foreign_storage::TypedParquetDetectBuffer:
+ Collaboration diagram for foreign_storage::TypedParquetDetectBuffer:

Classes

class  AbstractDataTypeToStringConverter
 
class  DataTypeToStringConverter
 

Public Member Functions

 TypedParquetDetectBuffer ()
 
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)
 
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 T >
void setConverterType (std::function< std::string(const T &)> element_to_string)
 
const std::vector< std::string > & getStrings ()
 
void appendValue (const std::string &value)
 
- 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< std::string > buffer_
 
std::unique_ptr
< AbstractDataTypeToStringConverter
data_to_string_converter_
 

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

Definition at line 23 of file TypedParquetDetectBuffer.h.

Constructor & Destructor Documentation

foreign_storage::TypedParquetDetectBuffer::TypedParquetDetectBuffer ( )

Definition at line 21 of file TypedParquetDetectBuffer.cpp.

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

Member Function Documentation

void foreign_storage::TypedParquetDetectBuffer::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 36 of file TypedParquetDetectBuffer.cpp.

References buffer_, CHECK, and data_to_string_converter_.

40  {
42  auto strings = data_to_string_converter_->convert(source, num_bytes);
43  buffer_.insert(buffer_.end(), strings.begin(), strings.end());
44 }
std::unique_ptr< AbstractDataTypeToStringConverter > data_to_string_converter_
#define CHECK(condition)
Definition: Logger.h:291
void foreign_storage::TypedParquetDetectBuffer::appendValue ( const std::string &  value)
inline

Definition at line 65 of file TypedParquetDetectBuffer.h.

References buffer_.

Referenced by foreign_storage::ParquetDetectStringEncoder::appendData(), and foreign_storage::ParquetArrayDetectEncoder::appendToDetectBuffer().

65 { buffer_.push_back(value); }

+ Here is the caller graph for this function:

int8_t * foreign_storage::TypedParquetDetectBuffer::getMemoryPtr ( )
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 46 of file TypedParquetDetectBuffer.cpp.

References UNREACHABLE.

46  {
47  UNREACHABLE();
48  return {};
49 }
#define UNREACHABLE()
Definition: Logger.h:338
const std::vector<std::string>& foreign_storage::TypedParquetDetectBuffer::getStrings ( )
inline

Definition at line 63 of file TypedParquetDetectBuffer.h.

References buffer_.

Referenced by foreign_storage::ParquetArrayDetectEncoder::getArraysCount().

63 { return buffer_; }

+ Here is the caller graph for this function:

Data_Namespace::MemoryLevel foreign_storage::TypedParquetDetectBuffer::getType ( ) const
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 56 of file TypedParquetDetectBuffer.cpp.

References Data_Namespace::CPU_LEVEL, and UNREACHABLE.

56  {
57  UNREACHABLE();
59 }
#define UNREACHABLE()
Definition: Logger.h:338
size_t foreign_storage::TypedParquetDetectBuffer::pageCount ( ) const
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 69 of file TypedParquetDetectBuffer.cpp.

References UNREACHABLE.

69  {
70  UNREACHABLE();
71  return 0; // Added to avoid "no return statement" compiler warning
72 }
#define UNREACHABLE()
Definition: Logger.h:338
size_t foreign_storage::TypedParquetDetectBuffer::pageSize ( ) const
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 74 of file TypedParquetDetectBuffer.cpp.

References UNREACHABLE.

74  {
75  UNREACHABLE();
76  return 0; // Added to avoid "no return statement" compiler warning
77 }
#define UNREACHABLE()
Definition: Logger.h:338
void foreign_storage::TypedParquetDetectBuffer::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 23 of file TypedParquetDetectBuffer.cpp.

References UNREACHABLE.

28  {
29  UNREACHABLE();
30 }
#define UNREACHABLE()
Definition: Logger.h:338
void foreign_storage::TypedParquetDetectBuffer::reserve ( size_t  additional_num_bytes)
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 32 of file TypedParquetDetectBuffer.cpp.

References UNREACHABLE.

32  {
33  UNREACHABLE();
34 }
#define UNREACHABLE()
Definition: Logger.h:338
size_t foreign_storage::TypedParquetDetectBuffer::reservedSize ( ) const
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 51 of file TypedParquetDetectBuffer.cpp.

References UNREACHABLE.

51  {
52  UNREACHABLE();
53  return 0;
54 }
#define UNREACHABLE()
Definition: Logger.h:338
void foreign_storage::TypedParquetDetectBuffer::reserveNumElements ( size_t  additional_num_elements)

Definition at line 79 of file TypedParquetDetectBuffer.cpp.

References buffer_.

79  {
80  buffer_.reserve(buffer_.size() + additional_num_elements);
81 }
template<typename T >
void foreign_storage::TypedParquetDetectBuffer::setConverterType ( std::function< std::string(const T &)>  element_to_string)
inline

Definition at line 58 of file TypedParquetDetectBuffer.h.

References data_to_string_converter_.

58  {
60  std::make_unique<DataTypeToStringConverter<T>>(element_to_string);
61  }
std::unique_ptr< AbstractDataTypeToStringConverter > data_to_string_converter_
void foreign_storage::TypedParquetDetectBuffer::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 61 of file TypedParquetDetectBuffer.cpp.

References UNREACHABLE.

65  {
66  UNREACHABLE();
67 }
#define UNREACHABLE()
Definition: Logger.h:338

Member Data Documentation

std::vector<std::string> foreign_storage::TypedParquetDetectBuffer::buffer_
private

Definition at line 98 of file TypedParquetDetectBuffer.h.

Referenced by append(), appendValue(), getStrings(), and reserveNumElements().

std::unique_ptr<AbstractDataTypeToStringConverter> foreign_storage::TypedParquetDetectBuffer::data_to_string_converter_
private

Definition at line 99 of file TypedParquetDetectBuffer.h.

Referenced by append(), and setConverterType().


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