gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r8738 - gnunet/src/datastore


From: gnunet
Subject: [GNUnet-SVN] r8738 - gnunet/src/datastore
Date: Fri, 17 Jul 2009 14:14:48 -0600

Author: grothoff
Date: 2009-07-17 14:14:47 -0600 (Fri, 17 Jul 2009)
New Revision: 8738

Modified:
   gnunet/src/datastore/perf_plugin_datastore.c
   gnunet/src/datastore/plugin_datastore_sqlite.c
Log:
stuff

Modified: gnunet/src/datastore/perf_plugin_datastore.c
===================================================================
--- gnunet/src/datastore/perf_plugin_datastore.c        2009-07-17 20:08:15 UTC 
(rev 8737)
+++ gnunet/src/datastore/perf_plugin_datastore.c        2009-07-17 20:14:47 UTC 
(rev 8738)
@@ -36,9 +36,10 @@
  * those take too long to run them in the usual "make check"
  * sequence.  Hence the value used for shipping is tiny.
  */
-#define MAX_SIZE 1024LL * 1024 * 128
+#define MAX_SIZE 1024LL * 1024
+/* * 128 */
 
-#define ITERATIONS 10
+#define ITERATIONS 2
 
 /**
  * Number of put operations equivalent to 1/10th of MAX_SIZE
@@ -170,13 +171,60 @@
                                  &test, crc);
       return GNUNET_OK;
     }
+  fprintf (stderr, ".");
   crc->api->next_request (next_cls,
                          GNUNET_NO);
   return GNUNET_OK;
 }
 
 
+
+/**
+ * Function called when the service shuts
+ * down.  Unloads our datastore plugin.
+ *
+ * @param api api to unload
+ */
 static void
+unload_plugin (struct GNUNET_DATASTORE_PluginFunctions * api,
+              struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+  char *name;
+  char *libname;
+
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_string (cfg,
+                                             "DATASTORE", "DATABASE", &name))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 _("No `%s' specified for `%s' in configuration!\n"),
+                 "DATABASE",
+                 "DATASTORE");
+      return;
+    }
+  GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name);
+  GNUNET_break (NULL == GNUNET_PLUGIN_unload (libname, api));
+  GNUNET_free (libname);
+  GNUNET_free (name);
+}
+
+
+
+/**
+ * Last task run during shutdown.  Disconnects us from
+ * the transport and core.
+ */
+static void
+cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  struct CpsRunContext *crc = cls;
+
+  unload_plugin (crc->api, crc->cfg);
+  GNUNET_free (crc);
+}
+
+
+static void
 test (void *cls,
       const struct GNUNET_SCHEDULER_TaskContext *tc)
 {  
@@ -237,6 +285,12 @@
       break;
     case RP_DONE:
       crc->api->drop (crc->api->cls);
+      GNUNET_SCHEDULER_add_delayed (crc->sched,
+                                   GNUNET_YES,
+                                   GNUNET_SCHEDULER_PRIORITY_IDLE,
+                                   GNUNET_SCHEDULER_NO_PREREQUISITE_TASK,
+                                   GNUNET_TIME_UNIT_ZERO,
+                                   &cleaning_task, crc);
       break;
     }
 }
@@ -276,53 +330,7 @@
 }
 
 
-/**
- * Function called when the service shuts
- * down.  Unloads our datastore plugin.
- *
- * @param api api to unload
- */
 static void
-unload_plugin (struct GNUNET_DATASTORE_PluginFunctions * api,
-              struct GNUNET_CONFIGURATION_Handle *cfg)
-{
-  char *name;
-  char *libname;
-
-  if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_string (cfg,
-                                             "DATASTORE", "DATABASE", &name))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 _("No `%s' specified for `%s' in configuration!\n"),
-                 "DATABASE",
-                 "DATASTORE");
-      return;
-    }
-  GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name);
-  GNUNET_break (NULL == GNUNET_PLUGIN_unload (libname, api));
-  GNUNET_free (libname);
-  GNUNET_free (name);
-}
-
-
-
-/**
- * Last task run during shutdown.  Disconnects us from
- * the transport and core.
- */
-static void
-cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
-  struct CpsRunContext *crc = cls;
-
-  unload_plugin (crc->api, crc->cfg);
-  GNUNET_free (crc);
-}
-
-
-
-static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
      char *const *args,
@@ -344,12 +352,6 @@
                              GNUNET_SCHEDULER_PRIORITY_KEEP,
                              GNUNET_SCHEDULER_NO_PREREQUISITE_TASK,
                              &test, crc);
-  GNUNET_SCHEDULER_add_delayed (s,
-                                GNUNET_YES,
-                                GNUNET_SCHEDULER_PRIORITY_IDLE,
-                                GNUNET_SCHEDULER_NO_PREREQUISITE_TASK,
-                                GNUNET_TIME_UNIT_FOREVER_REL,
-                                &cleaning_task, crc);
 }
 
 

Modified: gnunet/src/datastore/plugin_datastore_sqlite.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_sqlite.c      2009-07-17 20:08:15 UTC 
(rev 8737)
+++ gnunet/src/datastore/plugin_datastore_sqlite.c      2009-07-17 20:14:47 UTC 
(rev 8738)
@@ -969,13 +969,24 @@
                                   PluginIterator iter,
                                   void *iter_cls)
 {
+  struct GNUNET_TIME_Absolute now;
+  char *q1;
+  char *q2;
+
+  now = GNUNET_TIME_absolute_get ();
+  GNUNET_asprintf (&q1, SELECT_IT_EXPIRATION_TIME_1,
+                  now.value);
+  GNUNET_asprintf (&q2, SELECT_IT_EXPIRATION_TIME_2,
+                  now.value);
   basic_iter (cls,
              type, 
              GNUNET_NO, GNUNET_YES, 
              GNUNET_NO, GNUNET_YES,
-             SELECT_IT_NON_ANONYMOUS_1,
-             SELECT_IT_NON_ANONYMOUS_2, 
+             q1,
+             q2,
              iter, iter_cls);
+  GNUNET_free (q1);
+  GNUNET_free (q2);
 }
 
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]