diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-10-03 13:23:35 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-10-03 13:23:35 +0900 |
commit | e891aa916c09b3e79c02f7c486f3e1a1c015769a (patch) | |
tree | e0e3eb9c1828b8652c91bc9bb624395ebe256544 /src/include/gnunet_namestore_service.h | |
parent | 4611664be0ba79ec7029a74cf961f28f2a658241 (diff) | |
download | gnunet-e891aa916c09b3e79c02f7c486f3e1a1c015769a.tar.gz gnunet-e891aa916c09b3e79c02f7c486f3e1a1c015769a.zip |
NAMESTORE: Bulk store API and fix for delayed store activities
New API: GNUNET_NAMESTORE_records_store2 which allows the caller
to pass an array of records in order to facilitate bulk import of zone
data.
Further, the transactional API requires that monitors and namecache
updates are delayed until transactions are actually commited.
Diffstat (limited to 'src/include/gnunet_namestore_service.h')
-rw-r--r-- | src/include/gnunet_namestore_service.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index dc6aeaa69..b795494af 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -148,6 +148,43 @@ GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h, | |||
148 | void *cont_cls); | 148 | void *cont_cls); |
149 | 149 | ||
150 | /** | 150 | /** |
151 | * Store one or more record sets in the namestore. If any item is already present, | ||
152 | * it is replaced with the new record. Use an empty array to | ||
153 | * remove all records under the given name. | ||
154 | * | ||
155 | * The continuation is called after the records have been stored in the | ||
156 | * database. They may not yet have been commited. Monitors may be notified | ||
157 | * asynchronously (basically with a buffer when commited). | ||
158 | * However, if any monitor is consistently too slow to | ||
159 | * keep up with the changes, calling @a cont will be delayed until the | ||
160 | * monitors do keep up. | ||
161 | * Uncommited store requests within a transaction (GNUNET_NAMESTORE_transaction_begin) | ||
162 | * cause @a cont to be called immediately before the commit and before | ||
163 | * notification of monitors. | ||
164 | * | ||
165 | * @param h handle to the namestore | ||
166 | * @param pkey private key of the zone | ||
167 | * @param rd_set_count the number of record sets | ||
168 | * @param a_label an array of size @a rd_set_count of names for each record set | ||
169 | * @param a_rd_count an array of size @a rd_set_count containing the number of records in the corresponding 'rd' array | ||
170 | * @param a_rd an array of size @a rd_set_count of arrays of records with data to store | ||
171 | * @param cont continuation to call when done | ||
172 | * @param cont_cls closure for @a cont | ||
173 | * @return handle to abort the request | ||
174 | */ | ||
175 | |||
176 | struct GNUNET_NAMESTORE_QueueEntry * | ||
177 | GNUNET_NAMESTORE_records_store2 ( | ||
178 | struct GNUNET_NAMESTORE_Handle *h, | ||
179 | const struct GNUNET_IDENTITY_PrivateKey *pkey, | ||
180 | unsigned int rd_set_count, | ||
181 | const char **a_label, | ||
182 | unsigned int *a_rd_count, | ||
183 | const struct GNUNET_GNSRECORD_Data **a_rd, | ||
184 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | ||
185 | void *cont_cls); | ||
186 | |||
187 | /** | ||
151 | * Store an item in the namestore. If the item is already present, | 188 | * Store an item in the namestore. If the item is already present, |
152 | * it is replaced with the new record. Use an empty array to | 189 | * it is replaced with the new record. Use an empty array to |
153 | * remove all records under the given name. | 190 | * remove all records under the given name. |