gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13009 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r13009 - gnunet/src/dht
Date: Thu, 16 Sep 2010 17:20:40 +0200

Author: nevans
Date: 2010-09-16 17:20:40 +0200 (Thu, 16 Sep 2010)
New Revision: 13009

Modified:
   gnunet/src/dht/gnunet-dht-driver.c
   gnunet/src/dht/plugin_dhtlog_mysql.c
   gnunet/src/dht/plugin_dhtlog_mysql_dump.c
   gnunet/src/dht/plugin_dhtlog_mysql_dump_load.c
   gnunet/src/dht/test_dhtlog_data.conf
Log:
debug messages in driver, correct time (even for mysql_dump), change dhtlog 
testcase so it doesn't leave files after running

Modified: gnunet/src/dht/gnunet-dht-driver.c
===================================================================
--- gnunet/src/dht/gnunet-dht-driver.c  2010-09-16 14:16:15 UTC (rev 13008)
+++ gnunet/src/dht/gnunet-dht-driver.c  2010-09-16 15:20:40 UTC (rev 13009)
@@ -1305,7 +1305,7 @@
        */
       if ((peer_count->count == 0) && 
(GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0))
         {
-          GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Found peer with no 
connections, will choose some peers at random to connect to!\n");
+          GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Found peer with no 
connections, will choose some peer(s) at random to connect to!\n");
           GNUNET_CONTAINER_heap_iterate (find_peer_context->peer_min_heap, 
&iterate_min_heap_peers, find_peer_context);
           GNUNET_SCHEDULER_add_now(sched, &schedule_churn_find_peer_requests, 
find_peer_context);
         }
@@ -1368,6 +1368,7 @@
    */
   if (find_peer_context != NULL)
     {
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "We have churned on some peers, so 
we must schedule find peer requests for them!\n");
       for (i = 0; i < num_peers; i ++)
         {
           temp_daemon = GNUNET_TESTING_daemon_get(pg, i);
@@ -1380,6 +1381,7 @@
     }
   else
     {
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Only churned off peers, no find 
peer requests, scheduling more gets...\n");
       if (dhtlog_handle != NULL)
         {
           topo_ctx = GNUNET_malloc(sizeof(struct TopologyIteratorContext));
@@ -1988,12 +1990,17 @@
     GNUNET_SCHEDULER_add_delayed(sched, 
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, settle_time), 
&setup_puts_and_gets, NULL);
 
   if (GNUNET_YES == do_find_peer)
-  {
-    find_peer_context = GNUNET_malloc(sizeof(struct FindPeerContext));
-    find_peer_context->count_peers_cb = &count_peers_cb;
-    find_peer_context->endtime = 
GNUNET_TIME_relative_to_absolute(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS,
 settle_time));
-    GNUNET_SCHEDULER_add_now(sched, &schedule_find_peer_requests, 
find_peer_context);
-  }
+    {
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling find peer requests 
during \"settle\" time.\n");
+      find_peer_context = GNUNET_malloc(sizeof(struct FindPeerContext));
+      find_peer_context->count_peers_cb = &count_peers_cb;
+      find_peer_context->endtime = 
GNUNET_TIME_relative_to_absolute(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS,
 settle_time));
+      GNUNET_SCHEDULER_add_now(sched, &schedule_find_peer_requests, 
find_peer_context);
+    }
+  else
+    {
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Assuming automatic DHT find peer 
requests.\n");
+    }
 }
 
 /**
@@ -2432,7 +2439,7 @@
   churn_data = NULL;
   /** Check for a churn file to do churny simulation */
   if (GNUNET_OK ==
-      GNUNET_CONFIGURATION_get_value_string(cfg, "testing", "churn_file",
+      GNUNET_CONFIGURATION_get_value_string(cfg, "dht_testing", "churn_file",
                                             &churn_filename))
     {
       GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Reading churn data from %s\n", 
churn_filename);

Modified: gnunet/src/dht/plugin_dhtlog_mysql.c
===================================================================
--- gnunet/src/dht/plugin_dhtlog_mysql.c        2010-09-16 14:16:15 UTC (rev 
13008)
+++ gnunet/src/dht/plugin_dhtlog_mysql.c        2010-09-16 15:20:40 UTC (rev 
13009)
@@ -91,8 +91,8 @@
  */
 static MYSQL *conn;
 
-#define INSERT_QUERIES_STMT "INSERT INTO queries (trialuid, querytype, hops, 
dhtkeyuid, dhtqueryid, succeeded, nodeuid) "\
-                          "VALUES (?, ?, ?, ?, ?, ?, ?)"
+#define INSERT_QUERIES_STMT "INSERT INTO queries (trialuid, querytype, hops, 
dhtkeyuid, dhtqueryid, succeeded, nodeuid, time) "\
+                          "VALUES (?, ?, ?, ?, ?, ?, ?, NOW())"
 static struct StatementHandle *insert_query;
 
 #define INSERT_ROUTES_STMT "INSERT INTO routes (trialuid, querytype, hops, 
dhtkeyuid, dhtqueryid, succeeded, nodeuid, from_node, to_node) "\

Modified: gnunet/src/dht/plugin_dhtlog_mysql_dump.c
===================================================================
--- gnunet/src/dht/plugin_dhtlog_mysql_dump.c   2010-09-16 14:16:15 UTC (rev 
13008)
+++ gnunet/src/dht/plugin_dhtlog_mysql_dump.c   2010-09-16 15:20:40 UTC (rev 
13009)
@@ -51,8 +51,8 @@
  */
 static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
-#define INSERT_QUERIES_STMT "prepare insert_query from 'INSERT INTO queries 
(trialuid, querytype, hops, dhtkeyuid, dhtqueryid, succeeded, nodeuid) "\
-                          "VALUES (@temp_trial, ?, ?, ?, ?, ?, ?)'"
+#define INSERT_QUERIES_STMT "prepare insert_query from 'INSERT INTO queries 
(trialuid, querytype, hops, dhtkeyuid, dhtqueryid, succeeded, nodeuid, time) "\
+                          "VALUES (@temp_trial, ?, ?, ?, ?, ?, ?, ?)'"
 
 #define INSERT_ROUTES_STMT "prepare insert_route from 'INSERT INTO routes 
(trialuid, querytype, hops, dhtkeyuid, dhtqueryid, succeeded, nodeuid, 
from_node, to_node) "\
                           "VALUES (@temp_trial, ?, ?, ?, ?, ?, ?, ?, ?)'"
@@ -678,12 +678,12 @@
   if (ret < 0)
     return GNUNET_SYSERR;
 
-  ret = fprintf(outfile, "set @qid = %llu, @type = %u, @hops = %u, @succ = 
%d;\n", queryid, type, hops, succeeded);
+  ret = fprintf(outfile, "set @qid = %llu, @type = %u, @hops = %u, @succ = %d, 
@time = \"%s\";\n", queryid, type, hops, succeeded, get_sql_time());
 
   if (ret < 0)
     return GNUNET_SYSERR;
 
-  ret = fprintf(outfile, "execute insert_query using @type, @hops, 
@temp_dhtkey, @qid, @succ, @temp_node;\n");
+  ret = fprintf(outfile, "execute insert_query using @type, @hops, 
@temp_dhtkey, @qid, @succ, @temp_node, @time;\n");
 
   if (ret >= 0)
     return GNUNET_OK;

Modified: gnunet/src/dht/plugin_dhtlog_mysql_dump_load.c
===================================================================
--- gnunet/src/dht/plugin_dhtlog_mysql_dump_load.c      2010-09-16 14:16:15 UTC 
(rev 13008)
+++ gnunet/src/dht/plugin_dhtlog_mysql_dump_load.c      2010-09-16 15:20:40 UTC 
(rev 13009)
@@ -475,7 +475,7 @@
   if (ret < 0)
     return GNUNET_SYSERR;
 
-  ret = fprintf(query_outfile, "%s\t%llu\t%u\t%u\t%u\n", 
GNUNET_h2s_full(&node->hashPubKey), queryid, type, hops, succeeded);
+  ret = fprintf(query_outfile, "%s\t%llu\t%u\t%u\t%u\t%s\n", 
GNUNET_h2s_full(&node->hashPubKey), queryid, type, hops, succeeded, 
get_sql_time());
 
   if (ret >= 0)
     return GNUNET_OK;

Modified: gnunet/src/dht/test_dhtlog_data.conf
===================================================================
--- gnunet/src/dht/test_dhtlog_data.conf        2010-09-16 14:16:15 UTC (rev 
13008)
+++ gnunet/src/dht/test_dhtlog_data.conf        2010-09-16 15:20:40 UTC (rev 
13009)
@@ -36,8 +36,8 @@
 SERVICEHOME = /tmp/test-dhtlog/
 
 [DHTLOG]
-PLUGIN = mysql_dump
-#PLUGIN = dummy
+#PLUGIN = mysql_dump
+PLUGIN = dummy
 #PLUGIN = mysql
 
 [MYSQL]




reply via email to

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