Flex  0.17.9
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
gs::LocalWalWriter Class Reference

#include <local_wal_writer.h>

Inheritance diagram for gs::LocalWalWriter:
Inheritance graph
[legend]
Collaboration diagram for gs::LocalWalWriter:
Collaboration graph
[legend]

Public Member Functions

 LocalWalWriter ()=default
 
 ~LocalWalWriter ()
 
void open (const std::string &wal_uri, int thread_id) override
 
void close () override
 
bool append (const char *data, size_t length) override
 
std::string type () const override
 
- Public Member Functions inherited from gs::IWalWriter
virtual ~IWalWriter ()
 

Static Public Member Functions

static std::unique_ptr< IWalWriterMake ()
 

Static Public Attributes

static constexpr size_t TRUNC_SIZE = 1ul << 30
 

Private Attributes

int fd_
 
size_t file_size_
 
size_t file_used_
 

Static Private Attributes

static const bool registered_
 

Constructor & Destructor Documentation

◆ LocalWalWriter()

gs::LocalWalWriter::LocalWalWriter ( )
default

◆ ~LocalWalWriter()

gs::LocalWalWriter::~LocalWalWriter ( )
inline

Member Function Documentation

◆ append()

bool gs::LocalWalWriter::append ( const char *  data,
size_t  length 
)
overridevirtual

Append data to the wal file.

Implements gs::IWalWriter.

◆ close()

void gs::LocalWalWriter::close ( )
overridevirtual

Close the wal writer. If a remote connection is hold by the wal writer, it should be closed.

Implements gs::IWalWriter.

◆ Make()

std::unique_ptr< IWalWriter > gs::LocalWalWriter::Make ( )
static

◆ open()

void gs::LocalWalWriter::open ( const std::string &  uri,
int  thread_id 
)
overridevirtual

Open a wal file. In our design, each thread has its own wal file. The uri could be a file_path or a remote connection string.

Implements gs::IWalWriter.

◆ type()

std::string gs::LocalWalWriter::type ( ) const
inlineoverridevirtual

Implements gs::IWalWriter.

Member Data Documentation

◆ fd_

int gs::LocalWalWriter::fd_
private

◆ file_size_

size_t gs::LocalWalWriter::file_size_
private

◆ file_used_

size_t gs::LocalWalWriter::file_used_
private

◆ registered_

const bool gs::LocalWalWriter::registered_
staticprivate

◆ TRUNC_SIZE

constexpr size_t gs::LocalWalWriter::TRUNC_SIZE = 1ul << 30
staticconstexpr

The documentation for this class was generated from the following files:
gs::WalWriterFactory::wal_writer_initializer_t
std::unique_ptr< IWalWriter >(*)() wal_writer_initializer_t
Definition: wal.h:109
gs::LocalWalWriter::Make
static std::unique_ptr< IWalWriter > Make()
Definition: local_wal_writer.cc:24
gs::WalWriterFactory::RegisterWalWriter
static bool RegisterWalWriter(const std::string &wal_writer_type, wal_writer_initializer_t initializer)
Definition: wal.cc:66