-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.php_rocksdb_rc.php
292 lines (251 loc) · 7.34 KB
/
.php_rocksdb_rc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<?php
/**
* A PHP extension for interacting with RocksDB, built with Rust.
*/
class RocksDB {
/**
* Creates a new RocksDB instance with the specified path and TTL.
* @param string $path
* @param int|null $ttl_secs
*/
public function __construct(string $path, ?int $ttl_secs = null) {}
/**
* Inserts a key-value pair into the database.
* @param string $key
* @param string $value
* @param string|null $cf_name
* @return void
*/
public function put(string $key, string $value, ?string $cf_name = null) {}
/**
* Retrieves the value associated with the given key.
* @param string $key
* @param string|null $cf_name
* @return string|null
*/
public function get(string $key, ?string $cf_name = null): ?string {}
/**
* Merges a value into the database.
* @param string $key
* @param string $value
* @param string|null $cf_name
* @return void
*/
public function merge(string $key, string $value, ?string $cf_name = null) {}
/**
* Deletes the key-value pair associated with the given key.
* @param string $key
* @param string|null $cf_name
* @return void
*/
public function delete(string $key, ?string $cf_name = null) {}
/**
* Lists all column families in the database.
* @param string $path
* @return string[]
*/
public static function listColumnFamilies(string $path): array {}
/**
* Creates a new column family with the specified name.
* @param string $cf_name
* @return void
*/
public function createColumnFamily(string $cf_name) {}
/**
* Drops the column family with the specified name.
* @param string $cf_name
* @return void
*/
public function dropColumnFamily(string $cf_name) {}
/**
* Retrieves a database property.
* @param string $property
* @param string|null $cf_name
* @return string|null
*/
public function getProperty(string $property, ?string $cf_name = null): ?string {}
/**
* Flushes all memtable data to SST files.
* @param string|null $cf_name
* @return void
*/
public function flush(?string $cf_name = null) {}
/**
* Repairs a RocksDB database at the specified path.
* @param string $path
* @return void
*/
public static function repair(string $path) {}
/**
* Closes the RocksDB instance.
* @return void
*/
public function close() {}
/**
* Returns all key-value pairs in the database or column family.
* @param string|null $cf_name
* @return array
*/
public function all(?string $cf_name = null): array {}
/**
* Returns all keys in the database or column family.
* @param string|null $cf_name
* @return string[]
*/
public function keys(?string $cf_name = null): array {}
/**
* Moves the iterator to the first element.
* @return void
*/
public function seekToFirst() {}
/**
* Moves the iterator to the last element.
* @return void
*/
public function seekToLast() {}
/**
* Moves the iterator to the specified key or the nearest key greater than the specified key.
* @param string $key
* @return void
*/
public function seek(string $key) {}
/**
* Moves the iterator to the specified key or the nearest key less than or equal to the specified key.
* @param string $key
* @return void
*/
public function seekForPrev(string $key) {}
/**
* Checks if the current position of the iterator is valid.
* @return bool
*/
public function valid(): bool {}
/**
* Moves the iterator to the next element and returns the current key-value pair.
* @return array|null
*/
public function next(): ?array {}
/**
* Moves the iterator to the previous element and returns the current key-value pair.
* @return array|null
*/
public function prev(): ?array {}
}
class RocksDBBackup {
/**
* Creates a new RocksDBBackup instance with the specified path and TTL.
* @param string $path
* @param int|null $ttl_secs
*/
public function __construct(string $path, ?int $ttl_secs = null) {}
/**
* Initializes the backup engine with the specified path.
* @param string $backup_path
* @return void
*/
public function init(string $backup_path) {}
/**
* Creates a backup of the database.
* @return void
*/
public function create() {}
/**
* Returns information about the backups.
* @return array
*/
public function info(): array {}
/**
* Purges old backups, keeping the specified number of backups.
* @param int $num_backups_to_keep
* @return void
*/
public function purge_old(int $num_backups_to_keep) {}
/**
* Restores the database from a backup.
* @param int $backup_id
* @param string $restore_path
* @return void
*/
public function restore(int $backup_id, string $restore_path) {}
}
class RocksDBSnapshot {
/**
* Creates a new RocksDBSnapshot instance with the specified path and TTL.
* @param string $path
* @param int|null $ttl_secs
*/
public function __construct(string $path, ?int $ttl_secs = null) {}
/**
* Creates a snapshot of the current state of the database.
* @return void
*/
public function create() {}
/**
* Releases the current snapshot.
* @return void
*/
public function release() {}
}
class RocksDBTransaction {
/**
* Creates a new RocksDBTransaction instance with the specified path and TTL.
* @param string $path
* @param int|null $ttl_secs
*/
public function __construct(string $path, ?int $ttl_secs = null) {}
/**
* Starts a new transaction.
* @return void
*/
public function start() {}
/**
* Commits the current transaction.
* @return void
*/
public function commit() {}
/**
* Rolls back the current transaction.
* @return void
*/
public function rollback() {}
/**
* Sets a savepoint within the current transaction.
* @return void
*/
public function set_savepoint() {}
/**
* Rolls back the transaction to the last savepoint.
* @return void
*/
public function rollback_to_savepoint() {}
/**
* Puts a key-value pair into the current transaction.
* @param string $key
* @param string $value
* @param string|null $cf_name
* @return void
*/
public function put(string $key, string $value, ?string $cf_name = null) {}
/**
* Gets the value associated with the given key within the current transaction.
* @param string $key
* @param string|null $cf_name
* @return string|null
*/
public function get(string $key, ?string $cf_name = null): ?string {}
/**
* Deletes a key-value pair within the current transaction.
* @param string $key
* @param string|null $cf_name
* @return void
*/
public function delete(string $key, ?string $cf_name = null) {}
/**
* Merges a value within the current transaction.
* @param string $key
* @param string $value
* @param string|null $cf_name
* @return void
*/
public function merge(string $key, string $value, ?string $cf_name = null) {}
}