Home | Trees | Indices | Help |
|
---|
|
Interface of database abstraction.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Method Details |
Create a database object.
Note: The exceptional mode means that fatal errors caused by methods are reported by exceptions raised. The concurrent mode means that database operations by multiple threads are performed concurrently without the giant VM lock. However, it has a side effect that such methods with call back of Python code as DB#accept, DB#accept_bulk, DB#iterate, and Cursor#accept are disabled. |
Get the last happened error.
|
Open a database file.
Note: The tuning parameter "log" is for the original "tune_logger" and the value specifies the path of the log file, or "-" for the standard output, or "+" for the standard error. "logkinds" specifies kinds of logged messages and the value can be "debug", "info", "warn", or "error". "logpx" specifies the prefix of each log message. "opts" is for "tune_options" and the value can contain "s" for the small option, "l" for the linear option, and "c" for the compress option. "bnum" corresponds to "tune_bucket". "zcomp" is for "tune_compressor" and the value can be "zlib" for the ZLIB raw compressor, "def" for the ZLIB deflate compressor, "gz" for the ZLIB gzip compressor, "lzo" for the LZO compressor, "lzma" for the LZMA compressor, or "arc" for the Arcfour cipher. "zkey" specifies the cipher key of the compressor. "capcnt" is for "cap_count". "capsiz" is for "cap_size". "psiz" is for "tune_page". "rcomp" is for "tune_comparator" and the value can be "lex" for the lexical comparator, "dec" for the decimal comparator, "lexdesc" for the lexical descending comparator, or "decdesc" for the decimal descending comparator. "pccap" is for "tune_page_cache". "apow" is for "tune_alignment". "fpow" is for "tune_fbp". "msiz" is for "tune_map". "dfunit" is for "tune_defrag". Every opened database must be closed by the PolyDB::close method when it is no longer in use. It is not allowed for two or more database objects in the same process to keep their connections to the same database file at the same time. |
Close the database file.
|
Accept a visitor to a record.
Note: The operation for each record is performed atomically and other threads accessing the same record are blocked. To avoid deadlock, any explicit database operation must not be performed in this method. |
Accept a visitor to multiple records at once.
Note: The operations for specified records are performed atomically and other threads accessing the same records are blocked. To avoid deadlock, any explicit database operation must not be performed in this method. |
Iterate to accept a visitor for each record.
Note: The whole iteration is performed atomically and other threads are blocked. To avoid deadlock, any explicit database operation must not be performed in this method. |
Set the value of a record.
Note: If no record corresponds to the key, a new record is created. If the corresponding record exists, the value is overwritten. |
Add a record.
Note: If no record corresponds to the key, a new record is created. If the corresponding record exists, the record is not modified and false is returned. |
Replace the value of a record.
Note: If no record corresponds to the key, no new record is created and false is returned. If the corresponding record exists, the value is modified. |
Append the value of a record.
Note: If no record corresponds to the key, a new record is created. If the corresponding record exists, the given value is appended at the end of the existing value. |
Add a number to the numeric integer value of a record.
Note: The value is serialized as an 8-byte binary integer in big-endian order, not a decimal string. If existing value is not 8-byte, this method fails. |
Add a number to the numeric double value of a record.
Note: The value is serialized as an 16-byte binary fixed-point number in big-endian order, not a decimal string. If existing value is not 16-byte, this method fails. |
Perform compare-and-swap.
|
Remove a record.
Note: If no record corresponds to the key, false is returned. |
Retrieve the value of a record.
|
Retrieve the value of a record. Note: Equal to the original DB::get method except that the return value is string. |
Check the existence of a record.
|
Retrieve the value of a record and remove it atomically.
|
Retrieve the value of a record and remove it atomically. Note: Equal to the original DB::seize method except that the return value is string. |
Store records at once.
|
Remove records at once.
|
Retrieve records at once.
|
Retrieve records at once. Note: Equal to the original DB::get_bulk method except that the return value is string map. |
Remove all records.
|
Synchronize updated contents with the file and the device.
Note: The operation of the processor is performed atomically and other threads accessing the same record are blocked. To avoid deadlock, any explicit database operation must not be performed in this method. |
Occupy database by locking and do something meanwhile.
Note: The operation of the processor is performed atomically and other threads accessing the same record are blocked. To avoid deadlock, any explicit database operation must not be performed in this method. |
Create a copy of the database file.
|
Begin transaction.
|
End transaction.
|
Perform entire transaction by a functor.
|
Dump records into a snapshot file.
|
Load records from a snapshot file.
|
Get the number of records.
|
Get the size of the database file.
|
Get the path of the database file.
|
Get the miscellaneous status information.
|
Get keys matching a prefix string.
|
Get keys matching a regular expression string.
|
Get keys similar to a string in terms of the levenshtein distance.
|
Merge records from other databases.
|
Create a cursor object.
|
Process a cursor by a functor.
|
Remove the first record.
|
Remove the first record. Note: Equal to the original DB::shift method except that the return value is string. |
Set the rule about throwing exception.
|
Get the representing expression.
|
Get the string expression.
|
Process a database by a functor. (static method)
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri May 25 01:00:16 2012 | http://epydoc.sourceforge.net |