Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(storage-manager): move prefix related functions in crate #1325

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

J-Loudet
Copy link
Contributor

This change is motivated by the refactor of the Replication feature. In order to exchange metadata that can be processed by all Replicas, the key expressions associated with the data stored must be prefixed (when sent) and stripped (when received).

This commit exposes two functions, at the zenoh-plugin-storage-manager crate, that perform these operations.

The objective is to reuse these functions in the Replication refactor and, as we intend to move the Replication in its own crate, exposing them at the crate level makes it easier to then import them.

  • plugins/zenoh-plugin-storage-manager/src/lib.rs:
    • moved there the strip_prefix function,
    • moved there the get_prefixed function and renamed it to prefix.
  • plugins/zenoh-plugin-storage-manager/src/replica/mod.rs: updated the call to the previously named get_prefixed function.
  • plugins/zenoh-plugin-storage-manager/src/replica/storage.rs:
    • removed the strip_prefix method,
    • removed the prefix function,
    • updated the call to strip_prefix and get_prefixed.

@J-Loudet J-Loudet requested a review from JEnoch August 26, 2024 20:19
@J-Loudet J-Loudet force-pushed the refactor/strip-prefix branch from 5914a89 to 54dc75b Compare August 26, 2024 20:21
This change is motivated by the refactor of the Replication feature. In
order to exchange metadata that can be processed by all Replicas, the
key expressions associated with the data stored must be prefixed (when
sent) and stripped (when received).

This commit exposes two functions, at the `zenoh-plugin-storage-manager`
crate, that perform these operations.

The objective is to reuse these functions in the Replication refactor
and, as we intend to move the Replication in its own crate, exposing
them at the crate level makes it easier to then import them.

* plugins/zenoh-plugin-storage-manager/src/lib.rs:
  - moved there the `strip_prefix` function,
  - moved there the `get_prefixed` function and renamed it to `prefix`.
* plugins/zenoh-plugin-storage-manager/src/replica/mod.rs: updated the
  call to the previously named `get_prefixed` function.
* plugins/zenoh-plugin-storage-manager/src/replica/storage.rs:
  - removed the `strip_prefix` method,
  - removed the `prefix` function,
  - updated the call to `strip_prefix` and `get_prefixed`.
@J-Loudet J-Loudet force-pushed the refactor/strip-prefix branch from 54dc75b to 407e7ec Compare August 27, 2024 08:38
Copy link
Member

@JEnoch JEnoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@JEnoch JEnoch merged commit 335e83c into dev/1.0.0 Aug 29, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants