Skip to content

Review bulk uri

Yannick requested to merge review_bulk_uri into master

Review bulk URI to be explicit and centralized management. Especially, it's used to differentiate storage engine. A meaningless prefix constant usage were found in multiple places in the code with some confusion between bulk id and bulk URI making quite hard to follow.

This MR introduce a new class BulkURI that encapsulates encode/decoding the URI value. It contains 2 attributes:

  • bulkd id
  • storage engine version

Storage engine version encapsulates its specific prefix value used in URI value. This prefix is no longer exposed and not meant to be used directly. Storage engine version on construction, check is made explicit.

Usage examples:

    - ctor from URI string value:
        `bulk_uri = BulkURI.decode(uri_str)`

    - ctor explicit given a bulk_id and a storage version:
        `bulk_uri = BulkURI(bulk_id=bulk_id_value, version=BulkStorageVersion_V1)`

    - ctor explict using class method:
        `bulk_uri  = BulkURI.from_bulk_storage_V1(bulk_id_value)`

    - encode to URI string value:
        `uri_str: str = bulk_uri.encode()`

    - check which storage engine version is:
        `bulk_uri.storage_version == BulkStorageVersion_V0`
        `bulk_uri.is_bulk_storage_V0()`
Edited by Yannick

Merge request reports