Extracted from Pike v7.6 release 61 at 2005-12-30.
pike.ida.liu.se
[Top]
Mird
Mird.Glue
Mird.Glue.Mird

Method Mird.Glue.Mird()->create()


Method create

void Mird.Glue.Mird(string filename)
void Mird.Glue.Mird(string filename, mapping options)

Description

"flags" : string

database flags, see below

"block_size" : int

database block size; must be even 2^n database size is limited to 2^32 blocks, ie block_size*2^32 (8192*2^(32-5) is approximately 1Tb) (2048)

"frag_bits" : int

this sets the number of frags in a fragmented block, and address bits to locate them. the number of frags in a fragmented block is equal to 2^frag_bits-1, per default 2^5-1=32-1=31 This steals bits from the 32 bit address used to point out a chunk. (5)

"hashtrie_bits" : int

this is the number of bits in each hash-trie hash; 4*2^n must be a lot less then block_size (5)

"cache_size" : int

this is the number of blocks cached from the database; this is used for both read- and write cache. Note that the memory usage is constant, approximately block_size*cache_size bytes. (32)

"cache_search_length" : int

this is the closed hash maximum search length to find a block in the cache; note that this will result in linear time usage. (8)

"max_free_frag_blocks" : int

this is how many blocks with free space that is kept in a list to be used when a transaction is running. The closest fit of usage of these blocks are where the data will be stored. (10)

"file_mode" : int

this is the default mode the files are opened with; although affected by UMASK (0666)

"journal_readback_n" : int

this is how many journal entries are read back at once at transaction finish, cancel or copy time bytes needed is approximately 24*this number (200)


flags is a string with any of these characters:
"r" - readonly
"R" - readonly in a live system (one process writes, many reads)
"n" - don't create if it doesn't exist
"x" - exclusive (always create)
"s" - call fsync when finishing transactions
"S" - call sync(2) after fsync
"j" - complain if journal file is gone missing