diff options
Diffstat (limited to 'src/datastore/plugin_datastore_mysql.c')
-rw-r--r-- | src/datastore/plugin_datastore_mysql.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c index ac81c9011..fb1b13978 100644 --- a/src/datastore/plugin_datastore_mysql.c +++ b/src/datastore/plugin_datastore_mysql.c | |||
@@ -1348,6 +1348,7 @@ mysql_plugin_get_size (void *cls) | |||
1348 | * @param type type of the content | 1348 | * @param type type of the content |
1349 | * @param priority priority of the content | 1349 | * @param priority priority of the content |
1350 | * @param anonymity anonymity-level for the content | 1350 | * @param anonymity anonymity-level for the content |
1351 | * @param replication replication-level for the content | ||
1351 | * @param expiration expiration time for the content | 1352 | * @param expiration expiration time for the content |
1352 | * @param msg set to error message | 1353 | * @param msg set to error message |
1353 | * @return GNUNET_OK on success | 1354 | * @return GNUNET_OK on success |
@@ -1360,6 +1361,7 @@ mysql_plugin_put (void *cls, | |||
1360 | enum GNUNET_BLOCK_Type type, | 1361 | enum GNUNET_BLOCK_Type type, |
1361 | uint32_t priority, | 1362 | uint32_t priority, |
1362 | uint32_t anonymity, | 1363 | uint32_t anonymity, |
1364 | uint32_t replication, | ||
1363 | struct GNUNET_TIME_Absolute expiration, | 1365 | struct GNUNET_TIME_Absolute expiration, |
1364 | char **msg) | 1366 | char **msg) |
1365 | { | 1367 | { |
@@ -1688,6 +1690,26 @@ mysql_plugin_get (void *cls, | |||
1688 | 1690 | ||
1689 | 1691 | ||
1690 | /** | 1692 | /** |
1693 | * Get a random item for replication. Returns a single, not expired, random item | ||
1694 | * from those with the highest replication counters. The item's | ||
1695 | * replication counter is decremented by one IF it was positive before. | ||
1696 | * Call 'iter' with all values ZERO or NULL if the datastore is empty. | ||
1697 | * | ||
1698 | * @param cls closure | ||
1699 | * @param iter function to call the value (once only). | ||
1700 | * @param iter_cls closure for iter | ||
1701 | */ | ||
1702 | static void | ||
1703 | mysql_plugin_replication_get (void *cls, | ||
1704 | PluginIterator iter, void *iter_cls) | ||
1705 | { | ||
1706 | /* FIXME: not implemented! */ | ||
1707 | iter (iter_cls, NULL, NULL, 0, NULL, 0, 0, 0, | ||
1708 | GNUNET_TIME_UNIT_ZERO_ABS, 0); | ||
1709 | } | ||
1710 | |||
1711 | |||
1712 | /** | ||
1691 | * Update the priority for a particular key in the datastore. If | 1713 | * Update the priority for a particular key in the datastore. If |
1692 | * the expiration time in value is different than the time found in | 1714 | * the expiration time in value is different than the time found in |
1693 | * the datastore, the higher value should be kept. For the | 1715 | * the datastore, the higher value should be kept. For the |
@@ -1940,6 +1962,7 @@ libgnunet_plugin_datastore_mysql_init (void *cls) | |||
1940 | api->put = &mysql_plugin_put; | 1962 | api->put = &mysql_plugin_put; |
1941 | api->next_request = &mysql_plugin_next_request; | 1963 | api->next_request = &mysql_plugin_next_request; |
1942 | api->get = &mysql_plugin_get; | 1964 | api->get = &mysql_plugin_get; |
1965 | api->replication_get = &mysql_plugin_replication_get; | ||
1943 | api->update = &mysql_plugin_update; | 1966 | api->update = &mysql_plugin_update; |
1944 | api->iter_low_priority = &mysql_plugin_iter_low_priority; | 1967 | api->iter_low_priority = &mysql_plugin_iter_low_priority; |
1945 | api->iter_zero_anonymity = &mysql_plugin_iter_zero_anonymity; | 1968 | api->iter_zero_anonymity = &mysql_plugin_iter_zero_anonymity; |