diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-04-03 13:47:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-04-03 13:47:56 +0000 |
commit | 8c23a185ee8d3c16c5552668dced851f82986041 (patch) | |
tree | 83f59d2190ffadcdc5643ba36578b2c6766b0e42 /src/include/gnunet_datastore_service.h | |
parent | 1888cd7da7ae5e2c32faf66d3bef47ac7d225b35 (diff) | |
download | gnunet-8c23a185ee8d3c16c5552668dced851f82986041.tar.gz gnunet-8c23a185ee8d3c16c5552668dced851f82986041.zip |
changing datastore API to support replication level --- not fully implemented --- and adding GNUNET_FS_BlockOptions struct to replace prio/anonymity/expiration+replication args
Diffstat (limited to 'src/include/gnunet_datastore_service.h')
-rw-r--r-- | src/include/gnunet_datastore_service.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index e9cb8a76f..1e2e9e050 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2004, 2005, 2006, 2007, 2009, 2010 Christian Grothoff (and other contributing authors) | 3 | (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -122,8 +122,8 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, | |||
122 | 122 | ||
123 | /** | 123 | /** |
124 | * Store an item in the datastore. If the item is already present, | 124 | * Store an item in the datastore. If the item is already present, |
125 | * the priorities are summed up and the higher expiration time and | 125 | * the priorities and replication values are summed up and the higher |
126 | * lower anonymity level is used. | 126 | * expiration time and lower anonymity level is used. |
127 | * | 127 | * |
128 | * @param h handle to the datastore | 128 | * @param h handle to the datastore |
129 | * @param rid reservation ID to use (from "reserve"); use 0 if no | 129 | * @param rid reservation ID to use (from "reserve"); use 0 if no |
@@ -134,6 +134,7 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, | |||
134 | * @param type type of the content | 134 | * @param type type of the content |
135 | * @param priority priority of the content | 135 | * @param priority priority of the content |
136 | * @param anonymity anonymity-level for the content | 136 | * @param anonymity anonymity-level for the content |
137 | * @param replication how often should the content be replicated to other peers? | ||
137 | * @param expiration expiration time for the content | 138 | * @param expiration expiration time for the content |
138 | * @param queue_priority ranking of this request in the priority queue | 139 | * @param queue_priority ranking of this request in the priority queue |
139 | * @param max_queue_size at what queue size should this request be dropped | 140 | * @param max_queue_size at what queue size should this request be dropped |
@@ -154,6 +155,7 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, | |||
154 | enum GNUNET_BLOCK_Type type, | 155 | enum GNUNET_BLOCK_Type type, |
155 | uint32_t priority, | 156 | uint32_t priority, |
156 | uint32_t anonymity, | 157 | uint32_t anonymity, |
158 | uint32_t replication, | ||
157 | struct GNUNET_TIME_Absolute expiration, | 159 | struct GNUNET_TIME_Absolute expiration, |
158 | unsigned int queue_priority, | 160 | unsigned int queue_priority, |
159 | unsigned int max_queue_size, | 161 | unsigned int max_queue_size, |
@@ -323,7 +325,11 @@ GNUNET_DATASTORE_get_next (struct GNUNET_DATASTORE_Handle *h); | |||
323 | 325 | ||
324 | 326 | ||
325 | /** | 327 | /** |
326 | * Get a random value from the datastore. | 328 | * Get a random value from the datastore for content replication. |
329 | * Returns a single, random value among those with the highest | ||
330 | * replication score, lowering positive replication scores by one for | ||
331 | * the chosen value (if only content with a replication score exists, | ||
332 | * a random value is returned and replication scores are not changed). | ||
327 | * | 333 | * |
328 | * @param h handle to the datastore | 334 | * @param h handle to the datastore |
329 | * @param queue_priority ranking of this request in the priority queue | 335 | * @param queue_priority ranking of this request in the priority queue |
@@ -339,12 +345,12 @@ GNUNET_DATASTORE_get_next (struct GNUNET_DATASTORE_Handle *h); | |||
339 | * (or rather, will already have been invoked) | 345 | * (or rather, will already have been invoked) |
340 | */ | 346 | */ |
341 | struct GNUNET_DATASTORE_QueueEntry * | 347 | struct GNUNET_DATASTORE_QueueEntry * |
342 | GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, | 348 | GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, |
343 | unsigned int queue_priority, | 349 | unsigned int queue_priority, |
344 | unsigned int max_queue_size, | 350 | unsigned int max_queue_size, |
345 | struct GNUNET_TIME_Relative timeout, | 351 | struct GNUNET_TIME_Relative timeout, |
346 | GNUNET_DATASTORE_Iterator iter, | 352 | GNUNET_DATASTORE_Iterator iter, |
347 | void *iter_cls); | 353 | void *iter_cls); |
348 | 354 | ||
349 | 355 | ||
350 | /** | 356 | /** |