DBM::D...e::File(3pm)
π NAME π
okay bestie, welcome to the DBM::D...e::File(3pm) page β a User Contributed Perl Documentation moment β and the main character here is DBM::Deep::Engine::File, aka the engine for use with DBM::Deep::Storage::File. periodt.
π― PURPOSE π―
This is the engine for use with DBM::Deep::Storage::File. that's the whole vibe, no cap.
π EXTERNAL METHODS π
β¨ new() β¨
This takes a set of args. These args are described in the documentation for "new" in DBM::Deep. go read that if you need the full tea π«
π§ INTERNAL METHODS π§
The following methods are internal-use-only to DBM::Deep::Engine::File. so like, stay in your lane, bestie π
read_txn_slots()
This takes no arguments.
This will return an array with a 1 or 0 in each slot. Each spot represents one available transaction. If the slot is 1, that transaction is taken. If it is 0, the transaction is available. literally the vibe check for transactions β¨
write_txn_slots( @slots )
This takes an array of 1's and 0's. This array represents the transaction slots returned by read_txn_slots(). In other words, the following is true:
@x = read_txn_slots( write_txn_slots( @x ) );
(With the obviously missing object referents added back in.) iykyk π
get_running_txn_ids()
This takes no arguments.
This will return an array of taken transaction IDs. This wraps read_txn_slots(). she's giving convenience wrapper energy π
get_txn_staleness_counter( $trans_id )
This will return the staleness counter for the given transaction ID. Please see "STALENESS" in DBM::Deep::Engine for more information. go check the lore π
inc_txn_staleness_counter( $trans_id )
This will increment the staleness counter for the given transaction ID. Please see "STALENESS" in DBM::Deep::Engine for more information. same lore, but now we're incrementing π₯
get_entries()
This takes no arguments.
This returns a list of all the sectors that have been modified by this transaction. the receipts, basically π§Ύ
add_entry( $trans_id, $location )
This takes a transaction ID and a file location and marks the sector at that location as having been modified by the transaction identified by $trans_id.
This returns nothing.
NOTE: Unlike all the other_entries()methods, there are several cases where"$trans_id != $self->trans_id"for this method. so yeah, she's special like that π
reindex_entry( $old_loc, $new_loc )
This takes two locations (old and new, respectively). If a location that has been modified by this transaction is subsequently reindexed due to a bucketlist overflowing, then the entries hash needs to be made aware of this change.
This returns nothing. the entries hash said "not me forgetting," and we're fixing it π
clear_entries()
This takes no arguments. It will clear the entries list for the running transaction.
This returns nothing. clean slate, fresh start, slay πΈ
_write_file_header()
This writes the file header for a new file. This will write the various settings that set how the file is interpreted. setting the whole personality of the file, fr fr π
_read_file_header()
This reads the file header from an existing file. This will read the various settings that set how the file is interpreted. same settings, but now we're reading them back π
_apply_digest( @stuff )
This will apply the digest method (default to Digest::MD5::md5) to the arguments passed in and return the result. hashing moment β¨
_add_free_blist_sector( $offset, $size )
_add_free_data_sector( $offset, $size )
_add_free_index_sector( $offset, $size )
These methods are all wrappers around _add_free_sector(), providing the proper chain offset ($multiple) for the sector type. wrapper girlies doing wrapper things π«Ά
_add_free_sector( $multiple, $offset, $size )
_add_free_sector() takes the offset into the chains location, the offset of the sector, and the size of that sector. It will mark the sector as a free sector and put it into the list of sectors that are free of this type for use later.
This returns nothing.
NOTE: $size is unused? yes bestie, the original really said it with a question mark π
_request_blist_sector( $size )
_request_data_sector( $size )
_request_index_sector( $size )
These methods are all wrappers around _request_sector(), providing the proper chain offset ($multiple) for the sector type. more wrappers, more iconic behavior π
_request_sector( $multiple $size )
This takes the offset into the chains location and the size of that sector.
This returns the object with the sector. If there is an available free sector of that type, then it will be reused. If there isn't one, then a new one will be allocated. reuse queen β»οΈ
π ACCESSORS π
The following are readonly attributes.
byte_sizehash_sizehash_charsnum_txnsmax_bucketsblank_md5data_sector_sizetxn_bitfield_len
The following are read/write attributes.
trans_id/set_trans_id( $new_id )trans_loc/set_trans_loc( $new_loc )chains_loc/set_chains_loc( $new_loc )
_dump_file()
This method takes no arguments. It's used to print out a textual representation of the DBM::Deep DB file. It assumes the file is not-corrupted. so like, do not come for her if the file is corrupted, that's not her job π
okay that's the entire page, bestie β this one's from perl v5.42.0, dated 2023-11-13. mwah π
π¦ where this page comes from
- opensuse-leap 16.0: perl-DBM-Deep 2.0019-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms