aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_mysql.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/plugin_datastore_mysql.c')
-rw-r--r--src/datastore/plugin_datastore_mysql.c67
1 files changed, 20 insertions, 47 deletions
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c
index fb1b13978..b56e142fb 100644
--- a/src/datastore/plugin_datastore_mysql.c
+++ b/src/datastore/plugin_datastore_mysql.c
@@ -1709,6 +1709,25 @@ mysql_plugin_replication_get (void *cls,
1709} 1709}
1710 1710
1711 1711
1712
1713/**
1714 * Get a random item for expiration.
1715 * Call 'iter' with all values ZERO or NULL if the datastore is empty.
1716 *
1717 * @param cls closure
1718 * @param iter function to call the value (once only).
1719 * @param iter_cls closure for iter
1720 */
1721static void
1722mysql_plugin_expiration_get (void *cls,
1723 PluginIterator iter, void *iter_cls)
1724{
1725 /* FIXME: not implemented! */
1726 iter (iter_cls, NULL, NULL, 0, NULL, 0, 0, 0,
1727 GNUNET_TIME_UNIT_ZERO_ABS, 0);
1728}
1729
1730
1712/** 1731/**
1713 * Update the priority for a particular key in the datastore. If 1732 * Update the priority for a particular key in the datastore. If
1714 * the expiration time in value is different than the time found in 1733 * the expiration time in value is different than the time found in
@@ -1810,50 +1829,6 @@ mysql_plugin_iter_zero_anonymity (void *cls,
1810 * @param iter_cls closure for iter 1829 * @param iter_cls closure for iter
1811 */ 1830 */
1812static void 1831static void
1813mysql_plugin_iter_ascending_expiration (void *cls,
1814 enum GNUNET_BLOCK_Type type,
1815 PluginIterator iter,
1816 void *iter_cls)
1817{
1818 struct Plugin *plugin = cls;
1819 iterateHelper (plugin, type, GNUNET_YES, 2, iter, iter_cls);
1820}
1821
1822
1823/**
1824 * Select a subset of the items in the datastore and call
1825 * the given iterator for each of them.
1826 *
1827 * @param cls our "struct Plugin*"
1828 * @param type entries of which type should be considered?
1829 * Use 0 for any type.
1830 * @param iter function to call on each matching value;
1831 * will be called once with a NULL value at the end
1832 * @param iter_cls closure for iter
1833 */
1834static void
1835mysql_plugin_iter_migration_order (void *cls,
1836 enum GNUNET_BLOCK_Type type,
1837 PluginIterator iter,
1838 void *iter_cls)
1839{
1840 struct Plugin *plugin = cls;
1841 iterateHelper (plugin, 0, GNUNET_NO, 3, iter, iter_cls);
1842}
1843
1844
1845/**
1846 * Select a subset of the items in the datastore and call
1847 * the given iterator for each of them.
1848 *
1849 * @param cls our "struct Plugin*"
1850 * @param type entries of which type should be considered?
1851 * Use 0 for any type.
1852 * @param iter function to call on each matching value;
1853 * will be called once with a NULL value at the end
1854 * @param iter_cls closure for iter
1855 */
1856static void
1857mysql_plugin_iter_all_now (void *cls, 1832mysql_plugin_iter_all_now (void *cls,
1858 enum GNUNET_BLOCK_Type type, 1833 enum GNUNET_BLOCK_Type type,
1859 PluginIterator iter, 1834 PluginIterator iter,
@@ -1963,11 +1938,9 @@ libgnunet_plugin_datastore_mysql_init (void *cls)
1963 api->next_request = &mysql_plugin_next_request; 1938 api->next_request = &mysql_plugin_next_request;
1964 api->get = &mysql_plugin_get; 1939 api->get = &mysql_plugin_get;
1965 api->replication_get = &mysql_plugin_replication_get; 1940 api->replication_get = &mysql_plugin_replication_get;
1941 api->expiration_get = &mysql_plugin_expiration_get;
1966 api->update = &mysql_plugin_update; 1942 api->update = &mysql_plugin_update;
1967 api->iter_low_priority = &mysql_plugin_iter_low_priority;
1968 api->iter_zero_anonymity = &mysql_plugin_iter_zero_anonymity; 1943 api->iter_zero_anonymity = &mysql_plugin_iter_zero_anonymity;
1969 api->iter_ascending_expiration = &mysql_plugin_iter_ascending_expiration;
1970 api->iter_migration_order = &mysql_plugin_iter_migration_order;
1971 api->iter_all_now = &mysql_plugin_iter_all_now; 1944 api->iter_all_now = &mysql_plugin_iter_all_now;
1972 api->drop = &mysql_plugin_drop; 1945 api->drop = &mysql_plugin_drop;
1973 GNUNET_log_from (GNUNET_ERROR_TYPE_INFO, 1946 GNUNET_log_from (GNUNET_ERROR_TYPE_INFO,