aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/datastore_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/datastore_api.c')
-rw-r--r--src/datastore/datastore_api.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index cf6a2cc8e..344a70842 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -792,6 +792,7 @@ process_status_message (void *cls,
792 * @param type type of the content 792 * @param type type of the content
793 * @param priority priority of the content 793 * @param priority priority of the content
794 * @param anonymity anonymity-level for the content 794 * @param anonymity anonymity-level for the content
795 * @param replication how often should the content be replicated to other peers?
795 * @param expiration expiration time for the content 796 * @param expiration expiration time for the content
796 * @param queue_priority ranking of this request in the priority queue 797 * @param queue_priority ranking of this request in the priority queue
797 * @param max_queue_size at what queue size should this request be dropped 798 * @param max_queue_size at what queue size should this request be dropped
@@ -812,6 +813,7 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h,
812 enum GNUNET_BLOCK_Type type, 813 enum GNUNET_BLOCK_Type type,
813 uint32_t priority, 814 uint32_t priority,
814 uint32_t anonymity, 815 uint32_t anonymity,
816 uint32_t replication,
815 struct GNUNET_TIME_Absolute expiration, 817 struct GNUNET_TIME_Absolute expiration,
816 unsigned int queue_priority, 818 unsigned int queue_priority,
817 unsigned int max_queue_size, 819 unsigned int max_queue_size,
@@ -1274,7 +1276,11 @@ process_result_message (void *cls,
1274 1276
1275 1277
1276/** 1278/**
1277 * Get a random value from the datastore. 1279 * Get a random value from the datastore for content replication.
1280 * Returns a single, random value among those with the highest
1281 * replication score, lowering positive replication scores by one for
1282 * the chosen value (if only content with a replication score exists,
1283 * a random value is returned and replication scores are not changed).
1278 * 1284 *
1279 * @param h handle to the datastore 1285 * @param h handle to the datastore
1280 * @param queue_priority ranking of this request in the priority queue 1286 * @param queue_priority ranking of this request in the priority queue
@@ -1290,12 +1296,12 @@ process_result_message (void *cls,
1290 * (or rather, will already have been invoked) 1296 * (or rather, will already have been invoked)
1291 */ 1297 */
1292struct GNUNET_DATASTORE_QueueEntry * 1298struct GNUNET_DATASTORE_QueueEntry *
1293GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, 1299GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h,
1294 unsigned int queue_priority, 1300 unsigned int queue_priority,
1295 unsigned int max_queue_size, 1301 unsigned int max_queue_size,
1296 struct GNUNET_TIME_Relative timeout, 1302 struct GNUNET_TIME_Relative timeout,
1297 GNUNET_DATASTORE_Iterator iter, 1303 GNUNET_DATASTORE_Iterator iter,
1298 void *iter_cls) 1304 void *iter_cls)
1299{ 1305{
1300 struct GNUNET_DATASTORE_QueueEntry *qe; 1306 struct GNUNET_DATASTORE_QueueEntry *qe;
1301 struct GNUNET_MessageHeader *m; 1307 struct GNUNET_MessageHeader *m;