OmniSciDB  ba1bac9284
 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
 
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 58 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 41 of file ForeignStorageInterface.cpp.

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

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

References CHECK.

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

Definition at line 78 of file ForeignStorageInterface.h.

References buff_.

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

Implements Data_Namespace::AbstractBuffer.

Definition at line 95 of file ForeignStorageInterface.h.

References CHECK.

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

Implements Data_Namespace::AbstractBuffer.

Definition at line 100 of file ForeignStorageInterface.h.

References CHECK.

100  {
101  CHECK(false);
102  return 0;
103  }
#define CHECK(condition)
Definition: Logger.h:206
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:214
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 88 of file ForeignStorageInterface.h.

References CHECK.

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

Implements Data_Namespace::AbstractBuffer.

Definition at line 105 of file ForeignStorageInterface.h.

References CHECK.

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

Definition at line 37 of file ForeignStorageInterface.cpp.

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

37  {
39 }
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 80 of file ForeignStorageInterface.h.

References CHECK.

84  {
85  CHECK(false);
86  }
#define CHECK(condition)
Definition: Logger.h:206

Member Data Documentation

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

Definition at line 115 of file ForeignStorageInterface.h.

Referenced by append(), and moveBuffer().

const ChunkKey ForeignStorageBuffer::chunk_key_
private

Definition at line 113 of file ForeignStorageInterface.h.

Referenced by read(), and tryZeroCopy().

PersistentForeignStorageInterface* ForeignStorageBuffer::persistent_foreign_storage_
private

Definition at line 114 of file ForeignStorageInterface.h.

Referenced by read(), and tryZeroCopy().


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