diff options
author | David Barksdale <amatus@amat.us> | 2017-03-19 15:55:32 -0500 |
---|---|---|
committer | David Barksdale <amatus@amat.us> | 2017-03-19 17:38:36 -0500 |
commit | 2dde0202c5590eeb051c1346f2b66293d83b87ce (patch) | |
tree | 7997191912ee4c70959934d6c9783a0c9f450fec /src/fs/fs_api.h | |
parent | d17d833dfd93a81f3540d472d1be4dfb7e9cbd03 (diff) | |
download | gnunet-2dde0202c5590eeb051c1346f2b66293d83b87ce.tar.gz gnunet-2dde0202c5590eeb051c1346f2b66293d83b87ce.zip |
[datastore] Fix #3743
This change adds support for key == NULL to the datastore plugins
and replaces the offset argument with a next_uid and random arguments to
increase performance in the key == NULL case.
With the offset argument a datastore plugin would have to count all
matching keys before fetching the key at the right offset, which would
iterate over the entire database in the case of key == NULL.
The offset argument was used in two ways: to iterate over a set of
matching values and to start iteration at a random matching value. The new API
seperates these into two arguments: if random is true it will return a
random matching value, otherwise next_uid can be set to uid + 1 to return the
next matching value.
The random argument was not added to get_zero_anonymity. This function
is used to periodically insert zero anonymity values into the DHT. I
don't think it's necessary to randomize this.
Diffstat (limited to 'src/fs/fs_api.h')
-rw-r--r-- | src/fs/fs_api.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h index e85de94a7..be22ea73e 100644 --- a/src/fs/fs_api.h +++ b/src/fs/fs_api.h | |||
@@ -1464,21 +1464,11 @@ struct GNUNET_FS_UnindexContext | |||
1464 | struct GNUNET_CRYPTO_FileHashContext *fhc; | 1464 | struct GNUNET_CRYPTO_FileHashContext *fhc; |
1465 | 1465 | ||
1466 | /** | 1466 | /** |
1467 | * Which values have we seen already? | ||
1468 | */ | ||
1469 | struct GNUNET_CONTAINER_MultiHashMap *seen_dh; | ||
1470 | |||
1471 | /** | ||
1472 | * Overall size of the file. | 1467 | * Overall size of the file. |
1473 | */ | 1468 | */ |
1474 | uint64_t file_size; | 1469 | uint64_t file_size; |
1475 | 1470 | ||
1476 | /** | 1471 | /** |
1477 | * Random offset given to #GNUNET_DATASTORE_get_key. | ||
1478 | */ | ||
1479 | uint64_t roff; | ||
1480 | |||
1481 | /** | ||
1482 | * When did we start? | 1472 | * When did we start? |
1483 | */ | 1473 | */ |
1484 | struct GNUNET_TIME_Absolute start_time; | 1474 | struct GNUNET_TIME_Absolute start_time; |