1DBM::Deep::Engine::FileU(s3e)r Contributed Perl DocumentaDtBiMo:n:Deep::Engine::File(3)
2
3
4
6 DBM::Deep::Engine::File - engine for use with DBM::Deep::Storage::File
7
9 This is the engine for use with DBM::Deep::Storage::File.
10
12 new()
13 This takes a set of args. These args are described in the documentation
14 for "new" in DBM::Deep.
15
17 The following methods are internal-use-only to DBM::Deep::Engine::File.
18
19 read_txn_slots()
20 This takes no arguments.
21
22 This will return an array with a 1 or 0 in each slot. Each spot
23 represents one available transaction. If the slot is 1, that
24 transaction is taken. If it is 0, the transaction is available.
25
26 write_txn_slots( @slots )
27 This takes an array of 1's and 0's. This array represents the
28 transaction slots returned by "read_txn_slots()". In other words, the
29 following is true:
30
31 @x = read_txn_slots( write_txn_slots( @x ) );
32
33 (With the obviously missing object referents added back in.)
34
35 get_running_txn_ids()
36 This takes no arguments.
37
38 This will return an array of taken transaction IDs. This wraps
39 "read_txn_slots()".
40
41 get_txn_staleness_counter( $trans_id )
42 This will return the staleness counter for the given transaction ID.
43 Please see "STALENESS" in DBM::Deep::Engine for more information.
44
45 inc_txn_staleness_counter( $trans_id )
46 This will increment the staleness counter for the given transaction ID.
47 Please see "STALENESS" in DBM::Deep::Engine for more information.
48
49 get_entries()
50 This takes no arguments.
51
52 This returns a list of all the sectors that have been modified by this
53 transaction.
54
55 add_entry( $trans_id, $location )
56 This takes a transaction ID and a file location and marks the sector at
57 that location as having been modified by the transaction identified by
58 $trans_id.
59
60 This returns nothing.
61
62 NOTE: Unlike all the other _entries() methods, there are several cases
63 where "$trans_id != $self->trans_id" for this method.
64
65 reindex_entry( $old_loc, $new_loc )
66 This takes two locations (old and new, respectively). If a location
67 that has been modified by this transaction is subsequently reindexed
68 due to a bucketlist overflowing, then the entries hash needs to be made
69 aware of this change.
70
71 This returns nothing.
72
73 clear_entries()
74 This takes no arguments. It will clear the entries list for the running
75 transaction.
76
77 This returns nothing.
78
79 _write_file_header()
80 This writes the file header for a new file. This will write the various
81 settings that set how the file is interpreted.
82
83 _read_file_header()
84 This reads the file header from an existing file. This will read the
85 various settings that set how the file is interpreted.
86
87 _apply_digest( @stuff )
88 This will apply the digest method (default to Digest::MD5::md5) to the
89 arguments passed in and return the result.
90
91 _add_free_blist_sector( $offset, $size )
92 _add_free_data_sector( $offset, $size )
93 _add_free_index_sector( $offset, $size )
94 These methods are all wrappers around _add_free_sector(), providing the
95 proper chain offset ($multiple) for the sector type.
96
97 _add_free_sector( $multiple, $offset, $size )
98 _add_free_sector() takes the offset into the chains location, the
99 offset of the sector, and the size of that sector. It will mark the
100 sector as a free sector and put it into the list of sectors that are
101 free of this type for use later.
102
103 This returns nothing.
104
105 NOTE: $size is unused?
106
107 _request_blist_sector( $size )
108 _request_data_sector( $size )
109 _request_index_sector( $size )
110 These methods are all wrappers around _request_sector(), providing the
111 proper chain offset ($multiple) for the sector type.
112
113 _request_sector( $multiple $size )
114 This takes the offset into the chains location and the size of that
115 sector.
116
117 This returns the object with the sector. If there is an available free
118 sector of that type, then it will be reused. If there isn't one, then a
119 new one will be allocated.
120
121 ACCESSORS
122 The following are readonly attributes.
123
124 • byte_size
125
126 • hash_size
127
128 • hash_chars
129
130 • num_txns
131
132 • max_buckets
133
134 • blank_md5
135
136 • data_sector_size
137
138 • txn_bitfield_len
139
140 The following are read/write attributes.
141
142 • trans_id / set_trans_id( $new_id )
143
144 • trans_loc / set_trans_loc( $new_loc )
145
146 • chains_loc / set_chains_loc( $new_loc )
147
148 _dump_file()
149 This method takes no arguments. It's used to print out a textual
150 representation of the DBM::Deep DB file. It assumes the file is not-
151 corrupted.
152
153
154
155perl v5.36.0 2022-07-22 DBM::Deep::Engine::File(3)