Tkrzw
|
Interface of database manager. More...
#include <tkrzw_dbm.h>
Classes | |
class | FileProcessor |
Interface of processor for a record. More... | |
class | FileProcessorCopyFileData |
File processor to implement DBM::CopyFileData. More... | |
class | Iterator |
Interface of iterator for each record. More... | |
class | RecordCheckerCompareExchangeMulti |
Record checker to implement DBM::CompareExchangeMulti. More... | |
class | RecordCheckerRekey |
Record checker to implement DBM::Rekey. More... | |
class | RecordProcessor |
Interface of processor for a record. More... | |
class | RecordProcessorAppend |
Record processor to implement DBM::Append. More... | |
class | RecordProcessorCompareExchange |
Record processor to implement DBM::CompareExchange. More... | |
class | RecordProcessorExport |
Record processor to implement DBM::Export. More... | |
class | RecordProcessorGet |
Record processor to implement DBM::Get. More... | |
class | RecordProcessorIncrement |
Record processor to implement DBM::Increment. More... | |
class | RecordProcessorIterator |
Record processor to implement DBM::Iterator methods. More... | |
class | RecordProcessorLambda |
Record processor to implement DBM::Process with a lambda function. More... | |
class | RecordProcessorPopFirst |
Record processor to implement DBM::PopFirst. More... | |
class | RecordProcessorRemove |
Record processor to implement DBM::Remove. More... | |
class | RecordProcessorSet |
Record processor to implement DBM::Set. More... | |
class | RecordRemoverRekey |
Record remover to implement DBM::Rekey. More... | |
class | RecordSetterCompareExchangeMulti |
Record setter to implement DBM::CompareExchangeMulti. More... | |
class | RecordSetterRekey |
Record setter to implement DBM::Rekey. More... | |
class | UpdateLogger |
Interface of update logger. More... | |
Public Types | |
typedef std::function< std::string_view(std::string_view, std::string_view)> | RecordLambdaType |
Lambda function type to process a record. More... | |
Public Member Functions | |
virtual | ~DBM ()=default |
Destructor. More... | |
virtual Status | Open (const std::string &path, bool writable, int32_t options=File::OPEN_DEFAULT)=0 |
Opens a database file. More... | |
virtual Status | Close ()=0 |
Closes the database file. More... | |
virtual Status | Process (std::string_view key, RecordProcessor *proc, bool writable)=0 |
Processes a record with a processor. More... | |
virtual Status | Process (std::string_view key, RecordLambdaType rec_lambda, bool writable) |
Processes a record with a lambda function. More... | |
virtual Status | Get (std::string_view key, std::string *value=nullptr) |
Gets the value of a record of a key. More... | |
virtual std::string | GetSimple (std::string_view key, std::string_view default_value="") |
Gets the value of a record of a key, in a simple way. More... | |
virtual Status | GetMulti (const std::vector< std::string_view > &keys, std::map< std::string, std::string > *records) |
Gets the values of multiple records of keys, with a string view vector. More... | |
virtual Status | GetMulti (const std::initializer_list< std::string_view > &keys, std::map< std::string, std::string > *records) |
Gets the values of multiple records of keys, with an initializer list. More... | |
virtual Status | GetMulti (const std::vector< std::string > &keys, std::map< std::string, std::string > *records) |
Gets the values of multiple records of keys, with a string vector. More... | |
virtual Status | Set (std::string_view key, std::string_view value, bool overwrite=true, std::string *old_value=nullptr) |
Sets a record of a key and a value. More... | |
virtual Status | SetMulti (const std::map< std::string_view, std::string_view > &records, bool overwrite=true) |
Sets multiple records, with a map of string views. More... | |
virtual Status | SetMulti (const std::initializer_list< std::pair< std::string_view, std::string_view >> &records, bool overwrite=true) |
Sets multiple records, with an initializer list. More... | |
virtual Status | SetMulti (const std::map< std::string, std::string > &records, bool overwrite=true) |
Sets multiple records, with a map of strings. More... | |
virtual Status | Remove (std::string_view key, std::string *old_value=nullptr) |
Removes a record of a key. More... | |
virtual Status | RemoveMulti (const std::vector< std::string_view > &keys) |
Removes records of keys, with a string view vector. More... | |
virtual Status | RemoveMulti (const std::initializer_list< std::string_view > &keys) |
Removes records of keys, with an initializer list. More... | |
virtual Status | RemoveMulti (const std::vector< std::string > &keys) |
Removes records of keys, with a string vector. More... | |
virtual Status | Append (std::string_view key, std::string_view value, std::string_view delim="") |
Appends data at the end of a record of a key. More... | |
virtual Status | AppendMulti (const std::map< std::string_view, std::string_view > &records, std::string_view delim="") |
Appends data to multiple records, with a map of string views. More... | |
virtual Status | AppendMulti (const std::initializer_list< std::pair< std::string_view, std::string_view >> &records, std::string_view delim="") |
Appends data to multiple records, with an initializer list. More... | |
virtual Status | AppendMulti (const std::map< std::string, std::string > &records, std::string_view delim="") |
Appends data to multiple records, with a map of strings. More... | |
virtual Status | CompareExchange (std::string_view key, std::string_view expected, std::string_view desired, std::string *actual=nullptr, bool *found=nullptr) |
Compares the value of a record and exchanges if the condition meets. More... | |
virtual Status | Increment (std::string_view key, int64_t increment=1, int64_t *current=nullptr, int64_t initial=0) |
Increments the numeric value of a record. More... | |
virtual int64_t | IncrementSimple (std::string_view key, int64_t increment=1, int64_t initial=0) |
Increments the numeric value of a record, in a simple way. More... | |
virtual Status | ProcessMulti (const std::vector< std::pair< std::string_view, RecordProcessor * >> &key_proc_pairs, bool writable)=0 |
Processes multiple records with processors. More... | |
virtual Status | ProcessMulti (const std::vector< std::pair< std::string_view, RecordLambdaType >> &key_lambda_pairs, bool writable) |
Processes multiple records with lambda functions. More... | |
virtual Status | CompareExchangeMulti (const std::vector< std::pair< std::string_view, std::string_view >> &expected, const std::vector< std::pair< std::string_view, std::string_view >> &desired) |
Compares the values of records and exchanges if the condition meets. More... | |
virtual Status | Rekey (std::string_view old_key, std::string_view new_key, bool overwrite=true, bool copying=false, std::string *value=nullptr) |
Changes the key of a record. More... | |
virtual Status | ProcessFirst (RecordProcessor *proc, bool writable)=0 |
Processes the first record with a processor. More... | |
virtual Status | ProcessFirst (RecordLambdaType rec_lambda, bool writable) |
Processes the first record with a lambda function. More... | |
virtual Status | PopFirst (std::string *key=nullptr, std::string *value=nullptr) |
Gets the first record and removes it. More... | |
virtual Status | PushLast (std::string_view value, double wtime=-1, std::string *key=nullptr) |
Adds a record with a key of the current timestamp. More... | |
virtual Status | ProcessEach (RecordProcessor *proc, bool writable)=0 |
Processes each and every record in the database with a processor. More... | |
virtual Status | ProcessEach (RecordLambdaType rec_lambda, bool writable) |
Processes each and every record in the database with a lambda function. More... | |
virtual Status | Count (int64_t *count)=0 |
Gets the number of records. More... | |
virtual int64_t | CountSimple () |
Gets the number of records, in a simple way. More... | |
virtual Status | GetFileSize (int64_t *size)=0 |
Gets the current file size of the database. More... | |
virtual int64_t | GetFileSizeSimple () |
Gets the current file size of the database, in a simple way. More... | |
virtual Status | GetFilePath (std::string *path)=0 |
Gets the path of the database file. More... | |
virtual std::string | GetFilePathSimple () |
Gets the path of the database file, in a simple way. More... | |
virtual Status | GetTimestamp (double *timestamp)=0 |
Gets the timestamp in seconds of the last modified time. More... | |
virtual double | GetTimestampSimple () |
Gets the timestamp of the last modified time, in a simple way. More... | |
virtual Status | Clear ()=0 |
Removes all records. More... | |
virtual Status | Rebuild ()=0 |
Rebuilds the entire database. More... | |
virtual Status | ShouldBeRebuilt (bool *tobe)=0 |
Checks whether the database should be rebuilt. More... | |
virtual bool | ShouldBeRebuiltSimple () |
Checks whether the database should be rebuilt, in a simple way. More... | |
virtual Status | Synchronize (bool hard, FileProcessor *proc=nullptr)=0 |
Synchronizes the content of the database to the file system. More... | |
virtual Status | CopyFileData (const std::string &dest_path, bool sync_hard=false) |
Copies the content of the database file to another file. More... | |
virtual Status | Export (DBM *dest_dbm) |
Exports all records to another database. More... | |
virtual std::vector< std::pair< std::string, std::string > > | Inspect ()=0 |
Inspects the database. More... | |
virtual bool | IsOpen () const =0 |
Checks whether the database is open. More... | |
virtual bool | IsWritable () const =0 |
Checks whether the database is writable. More... | |
virtual bool | IsHealthy () const =0 |
Checks whether the database condition is healthy. More... | |
virtual bool | IsOrdered () const =0 |
Checks whether ordered operations are supported. More... | |
virtual std::unique_ptr< Iterator > | MakeIterator ()=0 |
Makes an iterator for each record. More... | |
virtual std::unique_ptr< DBM > | MakeDBM () const =0 |
Makes a new DBM object of the same concrete class. More... | |
virtual UpdateLogger * | GetUpdateLogger () const =0 |
Gets the logger to write all update operations. More... | |
virtual void | SetUpdateLogger (UpdateLogger *update_logger)=0 |
Sets the logger to write all update operations. More... | |
const std::type_info & | GetType () const |
Gets the type information of the actual class. More... | |
Static Public Attributes | |
static const std::string_view | ANY_DATA |
The special string_view value to represent any data. More... | |
Interface of database manager.
typedef std::function<std::string_view(std::string_view, std::string_view)> tkrzw::DBM::RecordLambdaType |
Lambda function type to process a record.
The first parameter is the key of the record. The second parameter is the value of the existing record, or NOOP if it the record doesn't exist. The return value is a string reference to NOOP, REMOVE, or the new record value.
|
virtualdefault |
Destructor.
|
pure virtual |
Opens a database file.
path | A path of the file. |
writable | If true, the file is writable. If false, it is read-only. |
options | Bit-sum options of File::OpenOption enums for opening the file. |
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Closes the database file.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Processes a record with a processor.
key | The key of the record. |
proc | The pointer to the processor object. |
writable | True if the processor can edit the record. |
If the specified record exists, the ProcessFull of the processor is called. Otherwise, the ProcessEmpty of the processor is called.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
virtual |
Processes a record with a lambda function.
key | The key of the record. |
rec_lambda | The lambda function to process a record. The first parameter is the key of the record. The second parameter is the value of the existing record, or RecordProcessor::NOOP if it the record doesn't exist. The return value is a string reference to RecordProcessor::NOOP, RecordProcessor::REMOVE, or the new record value. |
writable | True if the processor can edit the record. |
|
virtual |
Gets the value of a record of a key.
key | The key of the record. |
value | The pointer to a string object to contain the result value. If it is nullptr, the value data is ignored. |
Reimplemented in tkrzw::ShardDBM, tkrzw::PolyDBM, and tkrzw::HashDBM.
|
virtual |
Gets the value of a record of a key, in a simple way.
key | The key of the record. |
default_value | The value to be returned on failure. |
|
virtual |
Gets the values of multiple records of keys, with a string view vector.
keys | The keys of records to retrieve. |
records | The pointer to a map to store retrieved records. Keys which don't match existing records are ignored. |
|
virtual |
Gets the values of multiple records of keys, with an initializer list.
keys | The keys of records to retrieve. |
records | The pointer to a map to store retrieved records. Keys which don't match existing records are ignored. |
|
virtual |
Gets the values of multiple records of keys, with a string vector.
keys | The keys of records to retrieve. |
records | The pointer to a map to store retrieved records. Keys which don't match existing records are ignored. |
|
virtual |
Sets a record of a key and a value.
key | The key of the record. |
value | The value of the record. |
overwrite | Whether to overwrite the existing value if there's a record with the same key. If true, the existing value is overwritten by the new value. If false, the operation is given up and an error status is returned. |
old_value | The pointer to a string object to contain the old value. Assignment is done even on the duplication error. If it is nullptr, it is ignored. |
Reimplemented in tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, and tkrzw::HashDBM.
|
virtual |
Sets multiple records, with a map of string views.
records | The records to store. |
overwrite | Whether to overwrite the existing value if there's a record with the same key. If true, the existing value is overwritten by the new value. If false, the operation is given up and an error status is returned. |
|
virtual |
Sets multiple records, with an initializer list.
records | The records to store. |
overwrite | Whether to overwrite the existing value if there's a record with the same key. If true, the existing value is overwritten by the new value. If false, the operation is given up and an error status is returned. |
|
virtual |
Sets multiple records, with a map of strings.
records | The records to store. |
overwrite | Whether to overwrite the existing value if there's a record with the same key. If true, the existing value is overwritten by the new value. If false, the operation is given up and an error status is returned. |
|
virtual |
Removes a record of a key.
key | The key of the record. |
old_value | The pointer to a string object to contain the old value. If it is nullptr, it is ignored. |
Reimplemented in tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, and tkrzw::HashDBM.
|
virtual |
Removes records of keys, with a string view vector.
keys | The keys of records to remove. |
|
virtual |
Removes records of keys, with an initializer list.
keys | The keys of records to remove. |
|
virtual |
Removes records of keys, with a string vector.
keys | The keys of records to remove. |
|
virtual |
Appends data at the end of a record of a key.
key | The key of the record. |
value | The value to append. |
delim | The delimiter to put after the existing record. |
If there's no existing record, the value is set without the delimiter.
Reimplemented in tkrzw::TinyDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, and tkrzw::BabyDBM.
|
virtual |
Appends data to multiple records, with a map of string views.
records | The records to append. |
delim | The delimiter to put after the existing record. |
If there's no existing record, the value is set without the delimiter.
|
virtual |
Appends data to multiple records, with an initializer list.
records | The records to store. |
delim | The delimiter to put after the existing record. |
If there's no existing record, the value is set without the delimiter.
|
virtual |
Appends data to multiple records, with a map of strings.
records | The records to append. |
delim | The delimiter to put after the existing record. |
If there's no existing record, the value is set without the delimiter.
|
virtual |
Compares the value of a record and exchanges if the condition meets.
key | The key of the record. |
expected | The expected value. If the data is nullptr, no existing record is expected. If it is ANY_DATA, an existing record with any value is expacted. |
desired | The desired value. If the data is nullptr, the record is to be removed. If it is ANY_DATA, no update is done. |
actual | The pointer to a string object to contain the actual value of the existing record. If it is nullptr, it is ignored. |
found | The pointer to a variable to contain whether there is an existing record. If it is nullptr, it is ignored. |
|
virtual |
Increments the numeric value of a record.
key | The key of the record. |
increment | The incremental value. If it is INT64MIN, the current value is not changed and a new record is not created. |
current | The pointer to an integer to contain the current value. If it is nullptr, it is ignored. |
initial | The initial value. |
The record value is stored as an 8-byte big-endian integer. Negative is also supported.
|
virtual |
Increments the numeric value of a record, in a simple way.
key | The key of the record. |
increment | The incremental value. |
initial | The initial value. |
The record value is treated as a decimal integer. Negative is also supported.
|
pure virtual |
Processes multiple records with processors.
key_proc_pairs | Pairs of the keys and their processor objects. |
writable | True if the processors can edit the records. |
If the specified record exists, the ProcessFull of the processor is called. Otherwise, the ProcessEmpty of the processor is called.
|
virtual |
Processes multiple records with lambda functions.
key_lambda_pairs | Pairs of the keys and their lambda functions. The first parameter of the lambda functions is the key of the record, or RecordProcessor::NOOP if it the record doesn't exist. The return value is a string reference to RecordProcessor::NOOP, RecordProcessor::REMOVE, or the new record value. |
writable | True if the processors can edit the records. |
|
virtual |
Compares the values of records and exchanges if the condition meets.
expected | The record keys and their expected values. If the value data is nullptr, no existing record is expected. If the value is ANY_DATA, an existing record with any value is expacted. |
desired | The record keys and their desired values. If the value is nullptr, the record is to be removed. |
Reimplemented in tkrzw::ShardDBM.
|
virtual |
Changes the key of a record.
old_key | The old key of the record. |
new_key | The new key of the record. |
overwrite | Whether to overwrite the existing record of the new key. |
copying | Whether to retain the record of the old key. |
value | The pointer to a string object to contain the value of the record. If it is nullptr, the value data is ignored. |
This method is done atomically by ProcessMulti. The other threads observe that the record has either the old key or the new key. No intermediate states are observed.
|
pure virtual |
Processes the first record with a processor.
proc | The pointer to the processor object. |
writable | True if the processor can edit the record. |
If the first record exists, the ProcessFull of the processor is called. Otherwise, this method fails and no method of the processor is called. Whereas ordered databases have efficient implementations of this method, unordered databases have inefficient implementations.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
virtual |
Processes the first record with a lambda function.
rec_lambda | The lambda function to process a record. The first parameter is the key of the record. The second parameter is the value of the record. The return value is a string reference to RecordProcessor::NOOP, RecordProcessor::REMOVE, or the new record value. |
writable | True if the processor can edit the record. |
|
virtual |
Gets the first record and removes it.
key | The pointer to a string object to contain the key of the first record. If it is nullptr, it is ignored. |
value | The pointer to a string object to contain the value of the first record. If it is nullptr, it is ignored. |
|
virtual |
Adds a record with a key of the current timestamp.
value | The value of the record. |
wtime | The current wall time used to generate the key. If it is negative, the system clock is used. |
key | The pointer to a string object to contain the generated key of the record. If it is nullptr, it is ignored. |
The key is generated as an 8-bite big-endian binary string of the timestamp. If there is an existing record matching the generated key, the key is regenerated and the attempt is repeated until it succeeds.
|
pure virtual |
Processes each and every record in the database with a processor.
proc | The pointer to the processor object. |
writable | True if the processor can edit the record. |
The ProcessFull of the processor is called repeatedly for each record. The ProcessEmpty of the processor is called once before the iteration and once after the iteration.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
virtual |
Processes each and every record in the database with a lambda function.
rec_lambda | The lambda function to process a record. The first parameter is the key of the record. The second parameter is the value of the existing record, or RecordProcessor::NOOP if it the record doesn't exist. The return value is a string reference to RecordProcessor::NOOP, RecordProcessor::REMOVE, or the new record value. |
writable | True if the processor can edit the record. |
The lambda function is called repeatedly for each record. It is also called once before the iteration and once after the iteration with both the key and the value being RecordProcessor::NOOP.
|
pure virtual |
Gets the number of records.
count | The pointer to an integer object to contain the result count. |
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
virtual |
Gets the number of records, in a simple way.
|
pure virtual |
Gets the current file size of the database.
size | The pointer to an integer object to contain the result size. |
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
virtual |
Gets the current file size of the database, in a simple way.
|
pure virtual |
Gets the path of the database file.
path | The pointer to a string object to contain the result path. |
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
virtual |
Gets the path of the database file, in a simple way.
|
pure virtual |
Gets the timestamp in seconds of the last modified time.
timestamp | The pointer to a double object to contain the timestamp. |
The timestamp is updated when the database opened in the writable mode is closed or synchronized, even if no updating opertion is done.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
virtual |
Gets the timestamp of the last modified time, in a simple way.
|
pure virtual |
Removes all records.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Rebuilds the entire database.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Checks whether the database should be rebuilt.
tobe | The pointer to a boolean object to contain the result decision. |
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
virtual |
Checks whether the database should be rebuilt, in a simple way.
|
pure virtual |
Synchronizes the content of the database to the file system.
hard | True to do physical synchronization with the hardware or false to do only logical synchronization with the file system. |
proc | The pointer to the file processor object, whose Process method is called while the content of the file is synchronized. If it is nullptr, it is ignored. |
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
virtual |
Copies the content of the database file to another file.
dest_path | A path to the destination file. |
sync_hard | True to do physical synchronization with the hardware. |
Copying is done while the content is synchronized and stable. So, this method is suitable for making a backup file while running a database service.
Reimplemented in tkrzw::ShardDBM.
Exports all records to another database.
dest_dbm | The pointer to the destination database. |
|
pure virtual |
Inspects the database.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Checks whether the database is open.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Checks whether the database is writable.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Checks whether the database condition is healthy.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Checks whether ordered operations are supported.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Makes an iterator for each record.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Makes a new DBM object of the same concrete class.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Gets the logger to write all update operations.
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
|
pure virtual |
Sets the logger to write all update operations.
update_logger | The pointer to the update logger object. Ownership is not taken. If it is nullptr, no logger is used. |
Implemented in tkrzw::TreeDBM, tkrzw::TinyDBM, tkrzw::StdTreeDBM, tkrzw::StdHashDBM, tkrzw::SkipDBM, tkrzw::ShardDBM, tkrzw::PolyDBM, tkrzw::HashDBM, tkrzw::CacheDBM, and tkrzw::BabyDBM.
const std::type_info& tkrzw::DBM::GetType | ( | ) | const |
Gets the type information of the actual class.
|
static |
The special string_view value to represent any data.