diff options
Diffstat (limited to 'src/include/gnunet_datastore_service.h')
-rw-r--r-- | src/include/gnunet_datastore_service.h | 49 |
1 files changed, 8 insertions, 41 deletions
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index f594d8fa6..f851385c5 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -201,33 +201,6 @@ GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, | |||
201 | 201 | ||
202 | 202 | ||
203 | /** | 203 | /** |
204 | * Update a value in the datastore. | ||
205 | * | ||
206 | * @param h handle to the datastore | ||
207 | * @param uid identifier for the value | ||
208 | * @param priority how much to increase the priority of the value | ||
209 | * @param expiration new expiration value should be MAX of existing and this argument | ||
210 | * @param queue_priority ranking of this request in the priority queue | ||
211 | * @param max_queue_size at what queue size should this request be dropped | ||
212 | * (if other requests of higher priority are in the queue) | ||
213 | * @param cont continuation to call when done | ||
214 | * @param cont_cls closure for @a cont | ||
215 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | ||
216 | * cancel; note that even if NULL is returned, the callback will be invoked | ||
217 | * (or rather, will already have been invoked) | ||
218 | */ | ||
219 | struct GNUNET_DATASTORE_QueueEntry * | ||
220 | GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, | ||
221 | uint64_t uid, | ||
222 | uint32_t priority, | ||
223 | struct GNUNET_TIME_Absolute expiration, | ||
224 | unsigned int queue_priority, | ||
225 | unsigned int max_queue_size, | ||
226 | GNUNET_DATASTORE_ContinuationWithStatus cont, | ||
227 | void *cont_cls); | ||
228 | |||
229 | |||
230 | /** | ||
231 | * Explicitly remove some content from the database. @a cont will be | 204 | * Explicitly remove some content from the database. @a cont will be |
232 | * called with status #GNUNET_OK if content was removed, #GNUNET_NO if | 205 | * called with status #GNUNET_OK if content was removed, #GNUNET_NO if |
233 | * no matching entry was found and #GNUNET_SYSERR on all other types | 206 | * no matching entry was found and #GNUNET_SYSERR on all other types |
@@ -267,6 +240,7 @@ GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, | |||
267 | * @param type type of the content | 240 | * @param type type of the content |
268 | * @param priority priority of the content | 241 | * @param priority priority of the content |
269 | * @param anonymity anonymity-level for the content | 242 | * @param anonymity anonymity-level for the content |
243 | * @param replication how often should the content be replicated to other peers? | ||
270 | * @param expiration expiration time for the content | 244 | * @param expiration expiration time for the content |
271 | * @param uid unique identifier for the datum; | 245 | * @param uid unique identifier for the datum; |
272 | * maybe 0 if no unique identifier is available | 246 | * maybe 0 if no unique identifier is available |
@@ -279,6 +253,7 @@ typedef void | |||
279 | enum GNUNET_BLOCK_Type type, | 253 | enum GNUNET_BLOCK_Type type, |
280 | uint32_t priority, | 254 | uint32_t priority, |
281 | uint32_t anonymity, | 255 | uint32_t anonymity, |
256 | uint32_t replication, | ||
282 | struct GNUNET_TIME_Absolute expiration, | 257 | struct GNUNET_TIME_Absolute expiration, |
283 | uint64_t uid); | 258 | uint64_t uid); |
284 | 259 | ||
@@ -288,10 +263,8 @@ typedef void | |||
288 | * will only be called once. | 263 | * will only be called once. |
289 | * | 264 | * |
290 | * @param h handle to the datastore | 265 | * @param h handle to the datastore |
291 | * @param offset offset of the result (modulo num-results); set to | 266 | * @param next_uid return the result with lowest uid >= next_uid |
292 | * a random 64-bit value initially; then increment by | 267 | * @param random if true, return a random result instead of using next_uid |
293 | * one each time; detect that all results have been found by uid | ||
294 | * being again the first uid ever returned. | ||
295 | * @param key maybe NULL (to match all entries) | 268 | * @param key maybe NULL (to match all entries) |
296 | * @param type desired type, 0 for any | 269 | * @param type desired type, 0 for any |
297 | * @param queue_priority ranking of this request in the priority queue | 270 | * @param queue_priority ranking of this request in the priority queue |
@@ -305,7 +278,8 @@ typedef void | |||
305 | */ | 278 | */ |
306 | struct GNUNET_DATASTORE_QueueEntry * | 279 | struct GNUNET_DATASTORE_QueueEntry * |
307 | GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, | 280 | GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, |
308 | uint64_t offset, | 281 | uint64_t next_uid, |
282 | bool random, | ||
309 | const struct GNUNET_HashCode *key, | 283 | const struct GNUNET_HashCode *key, |
310 | enum GNUNET_BLOCK_Type type, | 284 | enum GNUNET_BLOCK_Type type, |
311 | unsigned int queue_priority, | 285 | unsigned int queue_priority, |
@@ -316,16 +290,9 @@ GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, | |||
316 | 290 | ||
317 | /** | 291 | /** |
318 | * Get a single zero-anonymity value from the datastore. | 292 | * Get a single zero-anonymity value from the datastore. |
319 | * Note that some implementations can ignore the 'offset' and | ||
320 | * instead return a random zero-anonymity value. In that case, | ||
321 | * detecting the wrap-around based on a repeating UID is at best | ||
322 | * probabilistic. | ||
323 | * | 293 | * |
324 | * @param h handle to the datastore | 294 | * @param h handle to the datastore |
325 | * @param offset offset of the result (modulo num-results); set to | 295 | * @param next_uid return the result with lowest uid >= next_uid |
326 | * a random 64-bit value initially; then increment by | ||
327 | * one each time; detect that all results have been found by uid | ||
328 | * being again the first uid ever returned. | ||
329 | * @param queue_priority ranking of this request in the priority queue | 296 | * @param queue_priority ranking of this request in the priority queue |
330 | * @param max_queue_size at what queue size should this request be dropped | 297 | * @param max_queue_size at what queue size should this request be dropped |
331 | * (if other requests of higher priority are in the queue) | 298 | * (if other requests of higher priority are in the queue) |
@@ -339,7 +306,7 @@ GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, | |||
339 | */ | 306 | */ |
340 | struct GNUNET_DATASTORE_QueueEntry * | 307 | struct GNUNET_DATASTORE_QueueEntry * |
341 | GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, | 308 | GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, |
342 | uint64_t offset, | 309 | uint64_t next_uid, |
343 | unsigned int queue_priority, | 310 | unsigned int queue_priority, |
344 | unsigned int max_queue_size, | 311 | unsigned int max_queue_size, |
345 | enum GNUNET_BLOCK_Type type, | 312 | enum GNUNET_BLOCK_Type type, |