OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ForeignStorageBuffer Class Reference

#include <ForeignStorageInterface.h>

+ Inheritance diagram for ForeignStorageBuffer:
+ Collaboration diagram for ForeignStorageBuffer:

Public Member Functions

 ForeignStorageBuffer (const ChunkKey &chunk_key, PersistentForeignStorageInterface *persistent_foreign_storage)
 
void read (int8_t *const dst, const size_t numBytes, const size_t offset=0, const Data_Namespace::MemoryLevel dstBufferType=Data_Namespace::CPU_LEVEL, const int dstDeviceId=-1) override
 
void append (int8_t *src, const size_t numBytes, const Data_Namespace::MemoryLevel srcBufferType=Data_Namespace::CPU_LEVEL, const int deviceId=-1) override
 
Data_Namespace::MemoryLevel getType () const override
 
std::vector< int8_t > moveBuffer ()
 
void write (int8_t *src, const size_t numBytes, const size_t offset=0, const Data_Namespace::MemoryLevel srcBufferType=Data_Namespace::CPU_LEVEL, const int srcDeviceId=-1) override
 
void reserve (size_t numBytes) override
 
int8_t * getMemoryPtr () override
 
size_t pageCount () const override
 
size_t pageSize () const override
 
size_t reservedSize () const override
 
- 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 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

const ChunkKey chunk_key_
 
PersistentForeignStorageInterfacepersistent_foreign_storage_
 
std::vector< int8_t > buff_
 

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 52 of file ForeignStorageInterface.h.

Constructor & Destructor Documentation

ForeignStorageBuffer::ForeignStorageBuffer ( const ChunkKey chunk_key,
PersistentForeignStorageInterface persistent_foreign_storage 
)

Definition at line 20 of file ForeignStorageInterface.cpp.

24  , chunk_key_(chunk_key)
25  , persistent_foreign_storage_(persistent_foreign_storage) {}
An AbstractBuffer is a unit of data management for a data manager.
PersistentForeignStorageInterface * persistent_foreign_storage_

Member Function Documentation

void ForeignStorageBuffer::append ( int8_t *  src,
const size_t  numBytes,
const Data_Namespace::MemoryLevel  srcBufferType = Data_Namespace::CPU_LEVEL,
const int  deviceId = -1 
)
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 37 of file ForeignStorageInterface.cpp.

References buff_, Data_Namespace::AbstractBuffer::setAppended(), Data_Namespace::AbstractBuffer::size_, and src.

40  {
41  setAppended();
42  buff_.insert(buff_.end(), src, src + numBytes);
43  size_ += numBytes;
44 }
int64_t * src
std::vector< int8_t > buff_

+ Here is the call graph for this function:

int8_t* ForeignStorageBuffer::getMemoryPtr ( )
inlineoverridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 84 of file ForeignStorageInterface.h.

References CHECK.

84  {
85  CHECK(false);
86  return nullptr;
87  }
#define CHECK(condition)
Definition: Logger.h:197
Data_Namespace::MemoryLevel ForeignStorageBuffer::getType ( ) const
inlineoverridevirtual
std::vector<int8_t> ForeignStorageBuffer::moveBuffer ( )
inline

Definition at line 72 of file ForeignStorageInterface.h.

References buff_.

72 { return std::move(buff_); }
std::vector< int8_t > buff_
size_t ForeignStorageBuffer::pageCount ( ) const
inlineoverridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 89 of file ForeignStorageInterface.h.

References CHECK.

89  {
90  CHECK(false);
91  return 0;
92  }
#define CHECK(condition)
Definition: Logger.h:197
size_t ForeignStorageBuffer::pageSize ( ) const
inlineoverridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 94 of file ForeignStorageInterface.h.

References CHECK.

94  {
95  CHECK(false);
96  return 0;
97  }
#define CHECK(condition)
Definition: Logger.h:197
void ForeignStorageBuffer::read ( int8_t *const  dst,
const size_t  numBytes,
const size_t  offset = 0,
const Data_Namespace::MemoryLevel  dstBufferType = Data_Namespace::CPU_LEVEL,
const int  dstDeviceId = -1 
)
overridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 27 of file ForeignStorageInterface.cpp.

References CHECK_EQ, chunk_key_, persistent_foreign_storage_, PersistentForeignStorageInterface::read(), and Data_Namespace::AbstractBuffer::sql_type_.

31  {
32  CHECK_EQ(size_t(0), offset);
33  CHECK_EQ(-1, dstDeviceId);
35 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
PersistentForeignStorageInterface * persistent_foreign_storage_
virtual void read(const ChunkKey &chunk_key, const SQLTypeInfo &sql_type, int8_t *dest, const size_t num_bytes)=0

+ Here is the call graph for this function:

void ForeignStorageBuffer::reserve ( size_t  numBytes)
inlineoverridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 82 of file ForeignStorageInterface.h.

References CHECK.

82 { CHECK(false); }
#define CHECK(condition)
Definition: Logger.h:197
size_t ForeignStorageBuffer::reservedSize ( ) const
inlineoverridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 99 of file ForeignStorageInterface.h.

References CHECK.

99  {
100  CHECK(false);
101  return 0;
102  }
#define CHECK(condition)
Definition: Logger.h:197
void ForeignStorageBuffer::write ( int8_t *  src,
const size_t  numBytes,
const size_t  offset = 0,
const Data_Namespace::MemoryLevel  srcBufferType = Data_Namespace::CPU_LEVEL,
const int  srcDeviceId = -1 
)
inlineoverridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 74 of file ForeignStorageInterface.h.

References CHECK.

78  {
79  CHECK(false);
80  }
#define CHECK(condition)
Definition: Logger.h:197

Member Data Documentation

std::vector<int8_t> ForeignStorageBuffer::buff_
private

Definition at line 107 of file ForeignStorageInterface.h.

Referenced by append(), and moveBuffer().

const ChunkKey ForeignStorageBuffer::chunk_key_
private

Definition at line 105 of file ForeignStorageInterface.h.

Referenced by read().

PersistentForeignStorageInterface* ForeignStorageBuffer::persistent_foreign_storage_
private

Definition at line 106 of file ForeignStorageInterface.h.

Referenced by read().


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