@@ -409,8 +409,8 @@ class DATASERVICE_READ_API VersionedLayerClient final {
409409 *
410410 * @param partition_id The partition ID that should be removed.
411411 *
412- * @note Before calling the API, specify a layer version. You can set it using
413- * the constructor or after the first online request.
412+ * @note Before calling the API, specify a catalog version. You can set it
413+ * using the constructor or after the first online request.
414414 *
415415 * @return True if partition data is removed successfully; false otherwise.
416416 */
@@ -421,8 +421,8 @@ class DATASERVICE_READ_API VersionedLayerClient final {
421421 *
422422 * @param tile The tile key that should be removed.
423423 *
424- * @note Before calling the API, specify a layer version. You can set it using
425- * the constructor or after the first online request.
424+ * @note Before calling the API, specify a catalog version. You can set it
425+ * using the constructor or after the first online request.
426426 *
427427 * @return True if tile data is removed successfully; false otherwise.
428428 */
@@ -433,8 +433,8 @@ class DATASERVICE_READ_API VersionedLayerClient final {
433433 *
434434 * @param partition_id The partition ID.
435435 *
436- * @note Before calling the API, specify a layer version. You can set it using
437- * the constructor or after the first online request.
436+ * @note Before calling the API, specify a catalog version. You can set it
437+ * using the constructor or after the first online request.
438438 *
439439 * @return True if the partition data is cached; false otherwise.
440440 */
@@ -447,8 +447,8 @@ class DATASERVICE_READ_API VersionedLayerClient final {
447447 * @param aggregated The aggregated flag, used to specify whether the tile is
448448 * aggregated or not.
449449 *
450- * @note Before calling the API, specify a layer version. You can set it using
451- * the constructor or after the first online request.
450+ * @note Before calling the API, specify a catalog version. You can set it
451+ * using the constructor or after the first online request.
452452 *
453453 * @return True if the tile data is cached; false otherwise.
454454 */
@@ -463,22 +463,45 @@ class DATASERVICE_READ_API VersionedLayerClient final {
463463 * not expire. The quadtree stays protected if at least one tile key is
464464 * protected.
465465 *
466+ * @note Before calling the API, specify a catalog version. You can set it
467+ * using the constructor or after the first online request.
468+ *
466469 * @note You can only protect tiles which data handles are present in the
467470 * cache at the time of the call.
468471 *
469472 * @note Please do not call `Protect` while the `Release` call for the same
470473 * catalog and layer is in progress.
471474 *
472- * @note Before calling the API, specify a layer version. You can set it using
473- * the constructor or after the first online request.
474- *
475475 * @param tiles The list of tile keys to be protected.
476476 *
477477 * @return True if some keys were successfully added to the protected list;
478478 * false otherwise.
479479 */
480480 bool Protect (const TileKeys& tiles);
481481
482+ /* *
483+ * @brief Protect partition from eviction.
484+ *
485+ * Protecting partition means that its data and metadata keys are added to the
486+ * protected list and stored in the cache. These keys are removed from the LRU
487+ * cache, so they could not be evicted. Also, they do not expire.
488+ *
489+ * @note Before calling the API, specify a catalog version. You can set it
490+ * using the constructor or after the first online request.
491+ *
492+ * @note You can only protect partitions which data handles are present in the
493+ * cache at the time of the call.
494+ *
495+ * @note Please do not call `Protect` while the `Release` call for the same
496+ * catalog and layer is in progress.
497+ *
498+ * @param partition_id Partition id to be protected.
499+ *
500+ * @return True if partition keys were successfully added to the protected
501+ * list; false otherwise.
502+ */
503+ bool Protect (const std::string& partition_id);
504+
482505 /* *
483506 * @brief Removes a list of tiles from protection.
484507 *
@@ -487,19 +510,40 @@ class DATASERVICE_READ_API VersionedLayerClient final {
487510 * Expiration value is restored, and keys can expire. The quadtree can be
488511 * removed from the protected list if all tile keys are no longer protected.
489512 *
513+ * @note Before calling the API, specify a catalog version. You can set it
514+ * using the constructor or after the first online request.
515+ *
490516 * @note Please make sure that `Protect` will not be called for the same
491517 * catalog and layer while the `Release` call is in progress.
492518 *
493- * @note Before calling the API, specify a layer version. You can set it using
494- * the constructor or after the first online request.
495- *
496519 * @param tiles The list of tile keys to be removed from protection.
497520 *
498521 * @return True if some keys were successfully removed from the protected
499522 * list; false otherwise.
500523 */
501524 bool Release (const TileKeys& tiles);
502525
526+ /* *
527+ * @brief Removes partition from protection.
528+ *
529+ * Releasing partition id removes data handle and metadata keys from the
530+ * protected list. The keys are added to the LRU cache, so they could be
531+ * evicted. Expiration value is restored, and related to partition keys can
532+ * expire.
533+ *
534+ * @note Before calling the API, specify a catalog version. You can set it
535+ * using the constructor or after the first online request.
536+ *
537+ * @note Please make sure that `Protect` will not be called for the same
538+ * catalog and layer while the `Release` call is in progress.
539+ *
540+ * @param partition_id Partition id to be removed from protection.
541+ *
542+ * @return True if keys related to partition were successfully removed from
543+ * the protected list; false otherwise.
544+ */
545+ bool Release (const std::string& partition_id);
546+
503547 private:
504548 std::unique_ptr<VersionedLayerClientImpl> impl_;
505549};
0 commit comments