[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r14846 - gnunet/src/datastore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r14846 - gnunet/src/datastore |
Date: |
Mon, 4 Apr 2011 16:20:33 +0200 |
Author: grothoff
Date: 2011-04-04 16:20:33 +0200 (Mon, 04 Apr 2011)
New Revision: 14846
Modified:
gnunet/src/datastore/perf_datastore_api.c
Log:
rewriting perf test to match new API --- now it fails...
Modified: gnunet/src/datastore/perf_datastore_api.c
===================================================================
--- gnunet/src/datastore/perf_datastore_api.c 2011-04-04 14:04:46 UTC (rev
14845)
+++ gnunet/src/datastore/perf_datastore_api.c 2011-04-04 14:20:33 UTC (rev
14846)
@@ -99,10 +99,6 @@
int j;
unsigned long long size;
int i;
-
- GNUNET_HashCode key;
- size_t esize;
- char data[65536];
};
@@ -165,33 +161,11 @@
fprintf (stderr, "D");
#endif
GNUNET_assert (GNUNET_OK == success);
- GNUNET_SCHEDULER_add_continuation (&run_continuation,
- crc,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ GNUNET_SCHEDULER_add_now (&run_continuation,
+ crc);
}
-
-static void
-do_delete (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
- struct CpsRunContext *crc = cls;
-
- stored_bytes -= crc->esize;
- stored_entries--;
- stored_ops++;
- GNUNET_DATASTORE_remove (datastore,
- &crc->key,
- crc->esize,
- crc->data,
- 1, 1, TIMEOUT,
- &remove_next,
- crc);
-}
-
-
-
static void
delete_value (void *cls,
const GNUNET_HashCode * key,
@@ -204,32 +178,22 @@
expiration, uint64_t uid)
{
struct CpsRunContext *crc = cls;
-
- if (key == NULL)
- {
- if (stored_bytes < MAX_SIZE)
- {
- crc->phase = RP_REPORT;
- GNUNET_SCHEDULER_add_continuation (&run_continuation,
- crc,
-
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- return;
- }
- GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_HIGH,
- &do_delete,
- crc);
- return;
- }
+
+ GNUNET_assert (NULL != key);
stored_ops++;
+ stored_bytes -= size;
+ stored_entries--;
+ stored_ops++;
if (stored_bytes < MAX_SIZE)
- {
- GNUNET_DATASTORE_iterate_get_next (datastore);
- return;
- }
- crc->key = *key;
- crc->esize = size;
- memcpy (crc->data, data, size);
- GNUNET_DATASTORE_iterate_get_next (datastore);
+ crc->phase = RP_PUT;
+ GNUNET_assert (NULL !=
+ GNUNET_DATASTORE_remove (datastore,
+ key,
+ size,
+ data,
+ 1, 1, TIMEOUT,
+ &remove_next,
+ crc));
}
@@ -315,7 +279,6 @@
}
-
static void
run_tests (void *cls,
int success,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r14846 - gnunet/src/datastore,
gnunet <=