Kyoto Cabinet
|
Basic implementation of database. More...
#include <kcdb.h>
Classes | |
class | Cursor |
Interface of cursor to indicate a record. More... | |
class | Error |
Error data. More... | |
class | FileProcessor |
Interface to process the database file. More... | |
class | Logger |
Interface to log internal information and errors. More... | |
class | MetaTrigger |
Interface to trigger meta database operations. More... | |
class | ProgressChecker |
Interface to check progress status of long process. More... | |
Public Types | |
enum | Type { TYPEVOID = 0x00, TYPEPHASH = 0x10, TYPEPTREE = 0x11, TYPESTASH = 0x18, TYPECACHE = 0x20, TYPEGRASS = 0x21, TYPEHASH = 0x30, TYPETREE = 0x31, TYPEDIR = 0x40, TYPEFOREST = 0x41, TYPETEXT = 0x50, TYPEMISC = 0x80 } |
Database types. More... | |
enum | OpenMode { OREADER = 1 << 0, OWRITER = 1 << 1, OCREATE = 1 << 2, OTRUNCATE = 1 << 3, OAUTOTRAN = 1 << 4, OAUTOSYNC = 1 << 5, ONOLOCK = 1 << 6, OTRYLOCK = 1 << 7, ONOREPAIR = 1 << 8 } |
Open modes. More... | |
Public Member Functions | |
virtual | ~BasicDB () |
Destructor. | |
virtual Error | error () const =0 |
Get the last happened error. | |
virtual void | set_error (const char *file, int32_t line, const char *func, Error::Code code, const char *message)=0 |
Set the error information. | |
virtual bool | open (const std::string &path, uint32_t mode=OWRITER|OCREATE)=0 |
Open a database file. | |
virtual bool | close ()=0 |
Close the database file. | |
virtual bool | accept_bulk (const std::vector< std::string > &keys, Visitor *visitor, bool writable=true)=0 |
Accept a visitor to multiple records at once. | |
virtual bool | iterate (Visitor *visitor, bool writable=true, ProgressChecker *checker=NULL)=0 |
Iterate to accept a visitor for each record. | |
virtual bool | scan_parallel (Visitor *visitor, size_t thnum, ProgressChecker *checker=NULL)=0 |
Scan each record in parallel. | |
virtual bool | synchronize (bool hard=false, FileProcessor *proc=NULL, ProgressChecker *checker=NULL)=0 |
Synchronize updated contents with the file and the device. | |
virtual bool | occupy (bool writable=true, FileProcessor *proc=NULL)=0 |
Occupy database by locking and do something meanwhile. | |
bool | copy (const std::string &dest, ProgressChecker *checker=NULL) |
Create a copy of the database file. | |
virtual bool | begin_transaction (bool hard=false)=0 |
Begin transaction. | |
virtual bool | begin_transaction_try (bool hard=false)=0 |
Try to begin transaction. | |
virtual bool | end_transaction (bool commit=true)=0 |
End transaction. | |
virtual int64_t | size ()=0 |
Get the size of the database file. | |
virtual std::string | path ()=0 |
Get the path of the database file. | |
virtual bool | status (std::map< std::string, std::string > *strmap)=0 |
Get the miscellaneous status information. | |
bool | set (const char *kbuf, size_t ksiz, const char *vbuf, size_t vsiz) |
Set the value of a record. | |
bool | set (const std::string &key, const std::string &value) |
Set the value of a record. | |
bool | add (const char *kbuf, size_t ksiz, const char *vbuf, size_t vsiz) |
Add a record. | |
bool | add (const std::string &key, const std::string &value) |
Set the value of a record. | |
bool | replace (const char *kbuf, size_t ksiz, const char *vbuf, size_t vsiz) |
Replace the value of a record. | |
bool | replace (const std::string &key, const std::string &value) |
Replace the value of a record. | |
bool | append (const char *kbuf, size_t ksiz, const char *vbuf, size_t vsiz) |
Append the value of a record. | |
bool | append (const std::string &key, const std::string &value) |
Set the value of a record. | |
int64_t | increment (const char *kbuf, size_t ksiz, int64_t num, int64_t orig=0) |
Add a number to the numeric value of a record. | |
int64_t | increment (const std::string &key, int64_t num, int64_t orig=0) |
Add a number to the numeric value of a record. | |
double | increment_double (const char *kbuf, size_t ksiz, double num, double orig=0) |
Add a number to the numeric double value of a record. | |
double | increment_double (const std::string &key, double num, double orig) |
Add a number to the numeric double value of a record. | |
bool | cas (const char *kbuf, size_t ksiz, const char *ovbuf, size_t ovsiz, const char *nvbuf, size_t nvsiz) |
Perform compare-and-swap. | |
bool | cas (const std::string &key, const std::string &ovalue, const std::string &nvalue) |
Perform compare-and-swap. | |
bool | remove (const char *kbuf, size_t ksiz) |
Remove a record. | |
bool | remove (const std::string &key) |
Remove a record. | |
char * | get (const char *kbuf, size_t ksiz, size_t *sp) |
Retrieve the value of a record. | |
bool | get (const std::string &key, std::string *value) |
Retrieve the value of a record. | |
int32_t | get (const char *kbuf, size_t ksiz, char *vbuf, size_t max) |
Retrieve the value of a record. | |
int32_t | check (const char *kbuf, size_t ksiz) |
Check the existence of a record. | |
int32_t | check (const std::string &key) |
Check the existence of a record. | |
char * | seize (const char *kbuf, size_t ksiz, size_t *sp) |
Retrieve the value of a record and remove it atomically. | |
bool | seize (const std::string &key, std::string *value) |
Retrieve the value of a record and remove it atomically. | |
int64_t | set_bulk (const std::map< std::string, std::string > &recs, bool atomic=true) |
Store records at once. | |
int64_t | remove_bulk (const std::vector< std::string > &keys, bool atomic=true) |
Remove records at once. | |
int64_t | get_bulk (const std::vector< std::string > &keys, std::map< std::string, std::string > *recs, bool atomic=true) |
Retrieve records at once. | |
bool | dump_snapshot (std::ostream *dest, ProgressChecker *checker=NULL) |
Dump records into a data stream. | |
bool | dump_snapshot (const std::string &dest, ProgressChecker *checker=NULL) |
Dump records into a file. | |
bool | load_snapshot (std::istream *src, ProgressChecker *checker=NULL) |
Load records from a data stream. | |
bool | load_snapshot (const std::string &src, ProgressChecker *checker=NULL) |
Load records from a file. | |
virtual Cursor * | cursor ()=0 |
Create a cursor object. | |
virtual void | log (const char *file, int32_t line, const char *func, Logger::Kind kind, const char *message)=0 |
Write a log message. | |
virtual bool | tune_logger (Logger *logger, uint32_t kinds=Logger::WARN|Logger::ERROR)=0 |
Set the internal logger. | |
virtual bool | tune_meta_trigger (MetaTrigger *trigger)=0 |
Set the internal meta operation trigger. | |
Static Public Member Functions | |
static const char * | typecname (uint32_t type) |
Get the class name of a database type. | |
static const char * | typestring (uint32_t type) |
Get the description string of a database type. |
Basic implementation of database.
Database types.
virtual kyotocabinet::BasicDB::~BasicDB | ( | ) | [virtual] |
Destructor.
virtual Error kyotocabinet::BasicDB::error | ( | ) | const [pure virtual] |
Get the last happened error.
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, kyotocabinet::DirDB, kyotocabinet::TextDB, and kyotocabinet::PolyDB.
virtual void kyotocabinet::BasicDB::set_error | ( | const char * | file, |
int32_t | line, | ||
const char * | func, | ||
Error::Code | code, | ||
const char * | message | ||
) | [pure virtual] |
Set the error information.
file | the file name of the program source code. |
line | the line number of the program source code. |
func | the function name of the program source code. |
code | an error code. |
message | a supplement message. |
virtual bool kyotocabinet::BasicDB::open | ( | const std::string & | path, |
uint32_t | mode = OWRITER|OCREATE |
||
) | [pure virtual] |
Open a database file.
path | the path of a database file. |
mode | the connection mode. BasicDB::OWRITER as a writer, BasicDB::OREADER as a reader. The following may be added to the writer mode by bitwise-or: BasicDB::OCREATE, which means it creates a new database if the file does not exist, BasicDB::OTRUNCATE, which means it creates a new database regardless if the file exists, BasicDB::OAUTOTRAN, which means each updating operation is performed in implicit transaction, BasicDB::OAUTOSYNC, which means each updating operation is followed by implicit synchronization with the file system. The following may be added to both of the reader mode and the writer mode by bitwise-or: BasicDB::ONOLOCK, which means it opens the database file without file locking, BasicDB::OTRYLOCK, which means locking is performed without blocking, File::ONOREPAIR, which means the database file is not repaired implicitly even if file destruction is detected. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, kyotocabinet::DirDB, kyotocabinet::TextDB, and kyotocabinet::PolyDB.
virtual bool kyotocabinet::BasicDB::close | ( | ) | [pure virtual] |
Close the database file.
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::PolyDB, kyotocabinet::DirDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, and kyotocabinet::TextDB.
virtual bool kyotocabinet::BasicDB::accept_bulk | ( | const std::vector< std::string > & | keys, |
Visitor * | visitor, | ||
bool | writable = true |
||
) | [pure virtual] |
Accept a visitor to multiple records at once.
keys | specifies a string vector of the keys. |
visitor | a visitor object. |
writable | true for writable operation, or false for read-only operation. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::DirDB, kyotocabinet::CacheDB, kyotocabinet::TextDB, kyotocabinet::StashDB, and kyotocabinet::PolyDB.
virtual bool kyotocabinet::BasicDB::iterate | ( | Visitor * | visitor, |
bool | writable = true , |
||
ProgressChecker * | checker = NULL |
||
) | [pure virtual] |
Iterate to accept a visitor for each record.
visitor | a visitor object. |
writable | true for writable operation, or false for read-only operation. |
checker | a progress checker object. If it is NULL, no checking is performed. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::DirDB, kyotocabinet::CacheDB, kyotocabinet::StashDB, kyotocabinet::TextDB, and kyotocabinet::PolyDB.
virtual bool kyotocabinet::BasicDB::scan_parallel | ( | Visitor * | visitor, |
size_t | thnum, | ||
ProgressChecker * | checker = NULL |
||
) | [pure virtual] |
Scan each record in parallel.
visitor | a visitor object. |
thnum | the number of worker threads. |
checker | a progress checker object. If it is NULL, no checking is performed. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::DirDB, kyotocabinet::StashDB, kyotocabinet::TextDB, and kyotocabinet::PolyDB.
virtual bool kyotocabinet::BasicDB::synchronize | ( | bool | hard = false , |
FileProcessor * | proc = NULL , |
||
ProgressChecker * | checker = NULL |
||
) | [pure virtual] |
Synchronize updated contents with the file and the device.
hard | true for physical synchronization with the device, or false for logical synchronization with the file system. |
proc | a postprocessor object. If it is NULL, no postprocessing is performed. |
checker | a progress checker object. If it is NULL, no checking is performed. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::PolyDB, kyotocabinet::DirDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, and kyotocabinet::TextDB.
virtual bool kyotocabinet::BasicDB::occupy | ( | bool | writable = true , |
FileProcessor * | proc = NULL |
||
) | [pure virtual] |
Occupy database by locking and do something meanwhile.
writable | true to use writer lock, or false to use reader lock. |
proc | a processor object. If it is NULL, no processing is performed. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::PolyDB, kyotocabinet::DirDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, and kyotocabinet::TextDB.
bool kyotocabinet::BasicDB::copy | ( | const std::string & | dest, |
ProgressChecker * | checker = NULL |
||
) |
Create a copy of the database file.
dest | the path of the destination file. |
checker | a progress checker object. If it is NULL, no checking is performed. |
virtual bool kyotocabinet::BasicDB::begin_transaction | ( | bool | hard = false | ) | [pure virtual] |
Begin transaction.
hard | true for physical synchronization with the device, or false for logical synchronization with the file system. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::PolyDB, kyotocabinet::DirDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, and kyotocabinet::TextDB.
virtual bool kyotocabinet::BasicDB::begin_transaction_try | ( | bool | hard = false | ) | [pure virtual] |
Try to begin transaction.
hard | true for physical synchronization with the device, or false for logical synchronization with the file system. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::PolyDB, kyotocabinet::DirDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, and kyotocabinet::TextDB.
virtual bool kyotocabinet::BasicDB::end_transaction | ( | bool | commit = true | ) | [pure virtual] |
End transaction.
commit | true to commit the transaction, or false to abort the transaction. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::PolyDB, kyotocabinet::DirDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, and kyotocabinet::TextDB.
virtual int64_t kyotocabinet::BasicDB::size | ( | ) | [pure virtual] |
Get the size of the database file.
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::PolyDB, kyotocabinet::DirDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, and kyotocabinet::TextDB.
virtual std::string kyotocabinet::BasicDB::path | ( | ) | [pure virtual] |
Get the path of the database file.
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::PolyDB, kyotocabinet::DirDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, and kyotocabinet::TextDB.
virtual bool kyotocabinet::BasicDB::status | ( | std::map< std::string, std::string > * | strmap | ) | [pure virtual] |
Get the miscellaneous status information.
strmap | a string map to contain the result. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::HashDB, kyotocabinet::PolyDB, kyotocabinet::DirDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, and kyotocabinet::TextDB.
bool kyotocabinet::BasicDB::set | ( | const char * | kbuf, |
size_t | ksiz, | ||
const char * | vbuf, | ||
size_t | vsiz | ||
) | [virtual] |
Set the value of a record.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
vbuf | the pointer to the value region. |
vsiz | the size of the value region. |
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::set | ( | const std::string & | key, |
const std::string & | value | ||
) | [virtual] |
Set the value of a record.
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::add | ( | const char * | kbuf, |
size_t | ksiz, | ||
const char * | vbuf, | ||
size_t | vsiz | ||
) | [virtual] |
Add a record.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
vbuf | the pointer to the value region. |
vsiz | the size of the value region. |
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::add | ( | const std::string & | key, |
const std::string & | value | ||
) | [virtual] |
Set the value of a record.
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::replace | ( | const char * | kbuf, |
size_t | ksiz, | ||
const char * | vbuf, | ||
size_t | vsiz | ||
) | [virtual] |
Replace the value of a record.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
vbuf | the pointer to the value region. |
vsiz | the size of the value region. |
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::replace | ( | const std::string & | key, |
const std::string & | value | ||
) | [virtual] |
Replace the value of a record.
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::append | ( | const char * | kbuf, |
size_t | ksiz, | ||
const char * | vbuf, | ||
size_t | vsiz | ||
) | [virtual] |
Append the value of a record.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
vbuf | the pointer to the value region. |
vsiz | the size of the value region. |
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::append | ( | const std::string & | key, |
const std::string & | value | ||
) | [virtual] |
Set the value of a record.
Implements kyotocabinet::DB.
int64_t kyotocabinet::BasicDB::increment | ( | const char * | kbuf, |
size_t | ksiz, | ||
int64_t | num, | ||
int64_t | orig = 0 |
||
) | [virtual] |
Add a number to the numeric value of a record.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
num | the additional number. |
orig | the origin number if no record corresponds to the key. If it is INT64MIN and no record corresponds, this function fails. If it is INT64MAX, the value is set as the additional number regardless of the current value. |
Implements kyotocabinet::DB.
int64_t kyotocabinet::BasicDB::increment | ( | const std::string & | key, |
int64_t | num, | ||
int64_t | orig = 0 |
||
) | [virtual] |
Add a number to the numeric value of a record.
Implements kyotocabinet::DB.
double kyotocabinet::BasicDB::increment_double | ( | const char * | kbuf, |
size_t | ksiz, | ||
double | num, | ||
double | orig = 0 |
||
) | [virtual] |
Add a number to the numeric double value of a record.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
num | the additional number. |
orig | the origin number if no record corresponds to the key. If it is negative infinity and no record corresponds, this function fails. If it is positive infinity, the value is set as the additional number regardless of the current value. |
Implements kyotocabinet::DB.
double kyotocabinet::BasicDB::increment_double | ( | const std::string & | key, |
double | num, | ||
double | orig | ||
) | [virtual] |
Add a number to the numeric double value of a record.
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::cas | ( | const char * | kbuf, |
size_t | ksiz, | ||
const char * | ovbuf, | ||
size_t | ovsiz, | ||
const char * | nvbuf, | ||
size_t | nvsiz | ||
) | [virtual] |
Perform compare-and-swap.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
ovbuf | the pointer to the old value region. NULL means that no record corresponds. |
ovsiz | the size of the old value region. |
nvbuf | the pointer to the new value region. NULL means that the record is removed. |
nvsiz | the size of new old value region. |
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::cas | ( | const std::string & | key, |
const std::string & | ovalue, | ||
const std::string & | nvalue | ||
) | [virtual] |
Perform compare-and-swap.
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::remove | ( | const char * | kbuf, |
size_t | ksiz | ||
) | [virtual] |
Remove a record.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::remove | ( | const std::string & | key | ) | [virtual] |
Remove a record.
Implements kyotocabinet::DB.
char* kyotocabinet::BasicDB::get | ( | const char * | kbuf, |
size_t | ksiz, | ||
size_t * | sp | ||
) | [virtual] |
Retrieve the value of a record.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
sp | the pointer to the variable into which the size of the region of the return value is assigned. |
Implements kyotocabinet::DB.
bool kyotocabinet::BasicDB::get | ( | const std::string & | key, |
std::string * | value | ||
) | [virtual] |
Retrieve the value of a record.
Implements kyotocabinet::DB.
int32_t kyotocabinet::BasicDB::get | ( | const char * | kbuf, |
size_t | ksiz, | ||
char * | vbuf, | ||
size_t | max | ||
) | [virtual] |
Retrieve the value of a record.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
vbuf | the pointer to the buffer into which the value of the corresponding record is written. |
max | the size of the buffer. |
Implements kyotocabinet::DB.
int32_t kyotocabinet::BasicDB::check | ( | const char * | kbuf, |
size_t | ksiz | ||
) | [virtual] |
Check the existence of a record.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
Implements kyotocabinet::DB.
int32_t kyotocabinet::BasicDB::check | ( | const std::string & | key | ) | [virtual] |
Check the existence of a record.
Implements kyotocabinet::DB.
char* kyotocabinet::BasicDB::seize | ( | const char * | kbuf, |
size_t | ksiz, | ||
size_t * | sp | ||
) |
Retrieve the value of a record and remove it atomically.
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
sp | the pointer to the variable into which the size of the region of the return value is assigned. |
bool kyotocabinet::BasicDB::seize | ( | const std::string & | key, |
std::string * | value | ||
) |
Retrieve the value of a record and remove it atomically.
int64_t kyotocabinet::BasicDB::set_bulk | ( | const std::map< std::string, std::string > & | recs, |
bool | atomic = true |
||
) |
Store records at once.
recs | the records to store. |
atomic | true to perform all operations atomically, or false for non-atomic operations. |
int64_t kyotocabinet::BasicDB::remove_bulk | ( | const std::vector< std::string > & | keys, |
bool | atomic = true |
||
) |
Remove records at once.
keys | the keys of the records to remove. |
atomic | true to perform all operations atomically, or false for non-atomic operations. |
int64_t kyotocabinet::BasicDB::get_bulk | ( | const std::vector< std::string > & | keys, |
std::map< std::string, std::string > * | recs, | ||
bool | atomic = true |
||
) |
Retrieve records at once.
keys | the keys of the records to retrieve. |
recs | a string map to contain the retrieved records. |
atomic | true to perform all operations atomically, or false for non-atomic operations. |
bool kyotocabinet::BasicDB::dump_snapshot | ( | std::ostream * | dest, |
ProgressChecker * | checker = NULL |
||
) |
Dump records into a data stream.
dest | the destination stream. |
checker | a progress checker object. If it is NULL, no checking is performed. |
bool kyotocabinet::BasicDB::dump_snapshot | ( | const std::string & | dest, |
ProgressChecker * | checker = NULL |
||
) |
Dump records into a file.
dest | the path of the destination file. |
checker | a progress checker object. If it is NULL, no checking is performed. |
bool kyotocabinet::BasicDB::load_snapshot | ( | std::istream * | src, |
ProgressChecker * | checker = NULL |
||
) |
Load records from a data stream.
src | the source stream. |
checker | a progress checker object. If it is NULL, no checking is performed. |
bool kyotocabinet::BasicDB::load_snapshot | ( | const std::string & | src, |
ProgressChecker * | checker = NULL |
||
) |
Load records from a file.
src | the path of the source file. |
checker | a progress checker object. If it is NULL, no checking is performed. |
virtual Cursor* kyotocabinet::BasicDB::cursor | ( | ) | [pure virtual] |
Create a cursor object.
Implements kyotocabinet::DB.
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::PolyDB, kyotocabinet::HashDB, kyotocabinet::DirDB, kyotocabinet::ProtoDB< STRMAP, DBTYPE >, kyotocabinet::CacheDB, kyotocabinet::StashDB, and kyotocabinet::TextDB.
virtual void kyotocabinet::BasicDB::log | ( | const char * | file, |
int32_t | line, | ||
const char * | func, | ||
Logger::Kind | kind, | ||
const char * | message | ||
) | [pure virtual] |
Write a log message.
file | the file name of the program source code. |
line | the line number of the program source code. |
func | the function name of the program source code. |
kind | the kind of the event. Logger::DEBUG for debugging, Logger::INFO for normal information, Logger::WARN for warning, and Logger::ERROR for fatal error. |
message | the supplement message. |
virtual bool kyotocabinet::BasicDB::tune_logger | ( | Logger * | logger, |
uint32_t | kinds = Logger::WARN|Logger::ERROR |
||
) | [pure virtual] |
Set the internal logger.
logger | the logger object. |
kinds | kinds of logged messages by bitwise-or: Logger::DEBUG for debugging, Logger::INFO for normal information, Logger::WARN for warning, and Logger::ERROR for fatal error. |
Implemented in kyotocabinet::PlantDB< BASEDB, DBTYPE >, kyotocabinet::PolyDB, kyotocabinet::HashDB, and kyotocabinet::DirDB.
virtual bool kyotocabinet::BasicDB::tune_meta_trigger | ( | MetaTrigger * | trigger | ) | [pure virtual] |
Set the internal meta operation trigger.
trigger | the trigger object. |
Implemented in kyotocabinet::PolyDB, kyotocabinet::HashDB, and kyotocabinet::DirDB.
static const char* kyotocabinet::BasicDB::typecname | ( | uint32_t | type | ) | [static] |
Get the class name of a database type.
type | the database type. |
static const char* kyotocabinet::BasicDB::typestring | ( | uint32_t | type | ) | [static] |
Get the description string of a database type.
type | the database type. |