hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
HCE::BaseDB Class Reference

Your Driver's class must be inherited from that base class class BaseDB. More...

#include <BaseDB.hpp>

Inheritance diagram for HCE::BaseDB:

Public Types

typedef Poco::SharedPtr
< HCE::BaseDB
BaseDBPtr

Public Member Functions

 BaseDB ()
virtual ~BaseDB ()
virtual void setDatabaseName (const std::string &dbName)
 set the database name
virtual void setDriverUrl (const std::string &dbUrl)
 set the driver URL
virtual void put (const std::string &key, const std::string &value)=0
 put document with given ID to Search Engine
virtual std::string get (const std::string &key)=0
 get document with given ID from Search Engine
virtual std::vector< std::string > get_all ()=0
 get all documents with given ID from Search Engine
virtual void del (const std::string &key)=0
 delete document with given ID from Search Engine
virtual int getLastError () const =0
 get status last performed operation. Must be called after method to get operation's status
void setWriteUnique (const bool writeUnique)
void setWritePolicy (const bool writePolicy)
const bool getWriteUnique () const
const bool getWritePolicy () const

Protected Attributes

std::string _dbName
std::list< std::string > _bootstrapUrls
STATUS _error
bool _writeUnique
bool _writePolicy

Detailed Description

Your Driver's class must be inherited from that base class class BaseDB.

A base Search Engine driver's class

Definition at line 47 of file BaseDB.hpp.

Member Typedef Documentation

typedef Poco::SharedPtr<HCE::BaseDB> HCE::BaseDB::BaseDBPtr

Definition at line 53 of file BaseDB.hpp.

Constructor & Destructor Documentation

HCE::BaseDB::BaseDB ( )
inline

Definition at line 50 of file BaseDB.hpp.

virtual HCE::BaseDB::~BaseDB ( )
inlinevirtual

Definition at line 51 of file BaseDB.hpp.

Member Function Documentation

virtual void HCE::BaseDB::del ( const std::string &  key)
pure virtual

delete document with given ID from Search Engine

A pure virtual member.

Parameters
keythe document's ID method must set _error to operation's result state: ACTION_SUCCESS - operation was completed successfully ACTION_GENERAL_FAILURE - operation was failed
Returns
document's content

Implemented in HCE::FakeDB, HCE::VoldemortDB, HCE::LevelDB, and HCE::AerospikeDB.

virtual std::string HCE::BaseDB::get ( const std::string &  key)
pure virtual

get document with given ID from Search Engine

A pure virtual member.

Parameters
keythe document's ID method must set _error to operation's result state: DOCUMENT_PRESENT - operation was completed successfully (document was present) DOCUMENT_NOT_PRESENT - operation was failed (document wasn't present)
Returns
document's content

Implemented in HCE::VoldemortDB, HCE::FakeDB, HCE::LevelDB, and HCE::AerospikeDB.

virtual std::vector<std::string> HCE::BaseDB::get_all ( )
pure virtual

get all documents with given ID from Search Engine

A pure virtual member.

Parameters
keythe document's ID method must set _error to operation's result state: DOCUMENT_PRESENT - operation was completed successfully (document was present) DOCUMENT_NOT_PRESENT - operation was failed (document wasn't present)
Returns
document's content

Implemented in HCE::FakeDB, HCE::VoldemortDB, HCE::LevelDB, and HCE::AerospikeDB.

virtual int HCE::BaseDB::getLastError ( ) const
pure virtual

get status last performed operation. Must be called after method to get operation's status

A pure virtual member.

Returns
operation's status

Implemented in HCE::FakeDB, HCE::VoldemortDB, HCE::LevelDB, and HCE::AerospikeDB.

const bool HCE::BaseDB::getWritePolicy ( ) const
inline

Definition at line 116 of file BaseDB.hpp.

const bool HCE::BaseDB::getWriteUnique ( ) const
inline

Definition at line 115 of file BaseDB.hpp.

virtual void HCE::BaseDB::put ( const std::string &  key,
const std::string &  value 
)
pure virtual

put document with given ID to Search Engine

A pure virtual member.

Parameters
keythe document's ID
valuethe document itself method must set _error to operation's result state: ACTION_SUCCESS - operation was completed successfully ACTION_GENERAL_FAILURE - operation was failed

Implemented in HCE::VoldemortDB, HCE::FakeDB, HCE::LevelDB, and HCE::AerospikeDB.

virtual void HCE::BaseDB::setDatabaseName ( const std::string &  dbName)
inlinevirtual

set the database name

Parameters
dbNamethe database name

Reimplemented in HCE::VoldemortDB, and HCE::LevelDB.

Definition at line 59 of file BaseDB.hpp.

virtual void HCE::BaseDB::setDriverUrl ( const std::string &  dbUrl)
inlinevirtual

set the driver URL

Parameters
dbUrlthe driver URL

Reimplemented in HCE::AerospikeDB.

Definition at line 64 of file BaseDB.hpp.

void HCE::BaseDB::setWritePolicy ( const bool  writePolicy)
inline

Definition at line 114 of file BaseDB.hpp.

void HCE::BaseDB::setWriteUnique ( const bool  writeUnique)
inline

Definition at line 113 of file BaseDB.hpp.

Member Data Documentation

std::list<std::string> HCE::BaseDB::_bootstrapUrls
protected

Definition at line 119 of file BaseDB.hpp.

std::string HCE::BaseDB::_dbName
protected

Definition at line 118 of file BaseDB.hpp.

STATUS HCE::BaseDB::_error
protected

Definition at line 120 of file BaseDB.hpp.

bool HCE::BaseDB::_writePolicy
protected

Definition at line 122 of file BaseDB.hpp.

bool HCE::BaseDB::_writeUnique
protected

Definition at line 121 of file BaseDB.hpp.


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