#include "gnunet_protocols.h"
#include "plugin_datastore.h"
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
/**
* Target datastore size (in bytes). Realistic sizes are
* 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 / 4
+// * 128
-#define ITERATIONS 10
+#define ITERATIONS 2
/**
* Number of put operations equivalent to 1/10th of MAX_SIZE
static GNUNET_HashCode key;
static int ic;
char *msg;
+ unsigned int prio;
/* most content is 32k */
size = 32 * 1024;
memset (value, i - 255, size / 2);
value[0] = k;
msg = NULL;
+ prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100);
if (GNUNET_OK != api->put (api->cls,
&key,
size,
value,
i,
- GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100),
+ prio,
i,
GNUNET_TIME_relative_to_absolute
(GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
&test, crc);
return GNUNET_OK;
}
+#if VERBOSE
+ fprintf (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n",
+ type, priority, size,
+ (unsigned long long) expiration.value);
+#endif
crc->cnt++;
crc->api->next_request (next_cls,
GNUNET_NO);
#include "plugin_datastore.h"
#include <sqlite3.h>
-#define DEBUG_SQLITE GNUNET_NO
+#define DEBUG_SQLITE GNUNET_YES
/**
* After how many payload-changing operations
GNUNET_ERROR_TYPE_ERROR |
GNUNET_ERROR_TYPE_BULK,
"sqlite3_reset");
+#if DEBUG_SQLITE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "No result found using either iterator\n");
+#endif
return GNUNET_NO;
}
sqlite3_stmt *stmt_1;
sqlite3_stmt *stmt_2;
+#if DEBUG_SQLITE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "At %llu, using queries `%s' and `%s'\n",
+ (unsigned long long) GNUNET_TIME_absolute_get ().value,
+ stmt_str_1,
+ stmt_str_2);
+#endif
if (sq_prepare (plugin->dbh, stmt_str_1, &stmt_1) != SQLITE_OK)
{
LOG_SQLITE (plugin, NULL,
now = GNUNET_TIME_absolute_get ();
GNUNET_asprintf (&q1, SELECT_IT_NON_ANONYMOUS_1,
- now.value);
+ (unsigned long long) now.value);
GNUNET_asprintf (&q2, SELECT_IT_NON_ANONYMOUS_2,
- now.value);
+ (unsigned long long) now.value);
basic_iter (cls,
type,
GNUNET_NO, GNUNET_YES,
now = GNUNET_TIME_absolute_get ();
GNUNET_asprintf (&q1, SELECT_IT_EXPIRATION_TIME_1,
- now.value);
+ (unsigned long long) 0*now.value);
GNUNET_asprintf (&q2, SELECT_IT_EXPIRATION_TIME_2,
- now.value);
+ (unsigned long long) 0*now.value);
basic_iter (cls,
type,
GNUNET_YES, GNUNET_NO,
now = GNUNET_TIME_absolute_get ();
GNUNET_asprintf (&q, SELECT_IT_MIGRATION_ORDER_2,
- now.value);
+ (unsigned long long) now.value);
basic_iter (cls,
type,
GNUNET_NO, GNUNET_NO,
plugin = nc->plugin;
if (SQLITE_ROW == (ret = sqlite3_step (nc->stmt)))
{
-#if DEBUG_SQLITE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Result found\n");
-#endif
return GNUNET_OK;
}
if (ret != SQLITE_DONE)