OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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
 
int8_t * tryZeroCopy (const size_t numBytes)
 
- 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

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

Constructor & Destructor Documentation

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

Definition at line 21 of file ForeignStorageInterface.cpp.

25  , chunk_key_(chunk_key)
26  , 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 42 of file ForeignStorageInterface.cpp.

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

45  {
46  setAppended();
47  buff_.insert(buff_.end(), src, src + numBytes);
48  size_ += numBytes;
49 }
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 92 of file ForeignStorageInterface.h.

References CHECK.

92  {
93  CHECK(false);
94  return nullptr;
95  }
#define CHECK(condition)
Definition: Logger.h:291
Data_Namespace::MemoryLevel ForeignStorageBuffer::getType ( ) const
inlineoverridevirtual
std::vector<int8_t> ForeignStorageBuffer::moveBuffer ( )
inline

Definition at line 80 of file ForeignStorageInterface.h.

References buff_.

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

Implements Data_Namespace::AbstractBuffer.

Definition at line 97 of file ForeignStorageInterface.h.

References CHECK.

97  {
98  CHECK(false);
99  return 0;
100  }
#define CHECK(condition)
Definition: Logger.h:291
size_t ForeignStorageBuffer::pageSize ( ) const
inlineoverridevirtual

Implements Data_Namespace::AbstractBuffer.

Definition at line 102 of file ForeignStorageInterface.h.

References CHECK.

102  {
103  CHECK(false);
104  return 0;
105  }
#define CHECK(condition)
Definition: Logger.h:291
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 28 of file ForeignStorageInterface.cpp.

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

32  {
33  CHECK_EQ(size_t(0), offset);
34  CHECK_EQ(-1, dstDeviceId);
36 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
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 90 of file ForeignStorageInterface.h.

References CHECK.

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

Implements Data_Namespace::AbstractBuffer.

Definition at line 107 of file ForeignStorageInterface.h.

References CHECK.

107  {
108  CHECK(false);
109  return 0;
110  }
#define CHECK(condition)
Definition: Logger.h:291
int8_t * ForeignStorageBuffer::tryZeroCopy ( const size_t  numBytes)

Definition at line 38 of file ForeignStorageInterface.cpp.

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

38  {
40 }
virtual int8_t * tryZeroCopy(const ChunkKey &chunk_key, const SQLTypeInfo &sql_type, const size_t num_bytes)
PersistentForeignStorageInterface * persistent_foreign_storage_

+ Here is the call graph for this function:

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

References CHECK.

86  {
87  CHECK(false);
88  }
#define CHECK(condition)
Definition: Logger.h:291

Member Data Documentation

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

Definition at line 117 of file ForeignStorageInterface.h.

Referenced by append(), and moveBuffer().

const ChunkKey ForeignStorageBuffer::chunk_key_
private

Definition at line 115 of file ForeignStorageInterface.h.

Referenced by read(), and tryZeroCopy().

PersistentForeignStorageInterface* ForeignStorageBuffer::persistent_foreign_storage_
private

Definition at line 116 of file ForeignStorageInterface.h.

Referenced by read(), and tryZeroCopy().


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