Skip to content

Blob Storage#7

Merged
mikolajkarbowski merged 4 commits into
developfrom
feature/command-commit
Sep 29, 2025
Merged

Blob Storage#7
mikolajkarbowski merged 4 commits into
developfrom
feature/command-commit

Conversation

@mikolajkarbowski
Copy link
Copy Markdown
Contributor

Dodany blob storage, teraz przy dodawaniu pliku do indeksu oprócz hashowania tworzony jest blob, kompresowany i zapisywany w folderze objects.
Wydzieleniłem też MutableRepositoryLayout aby móc współdzielić RepositoryLayout między wieloma wątkami

@adamgracikowski adamgracikowski changed the title blob storage Blob Storage Sep 22, 2025
Copy link
Copy Markdown
Contributor

@adamgracikowski adamgracikowski left a comment

Choose a reason for hiding this comment

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

Bardzo fajnie, drobne uwagi/pytania w komentarzach ✔️

Comment thread engine/src/errors/engine_error.rs Outdated
Comment thread engine/src/index/meva_hasher.rs
Comment thread engine/src/hasher/meva_hasher.rs
Comment thread engine/src/object_storage/meva_object.rs
Comment thread engine/src/object_storage/meva_object.rs Outdated
Comment thread engine/src/object_storage/meva_object.rs Outdated
Comment thread engine/src/object_storage/meva_object.rs Outdated
Comment thread engine/src/object_storage/meva_object_storage.rs Outdated
/// Objects are compressed using Zlib for efficient storage.
pub struct ObjectStorage<'a> {
/// Provides access to repository paths such as the `objects` directory.
repo_layout: &'a dyn RepositoryLayout,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nie wiem w sumie co lepsze, czy tak jak masz, czy przy użyciu Box<dyn RepositoryLayout>?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Też jeszcze nie znam na tyle rusta żeby powiedzieć co jest lepsze. Na pewno zalętą &'a dyn Trait jest to że nie trzeba nic alokować na stercie, nie ma dodatkowego kosztu jaki dodaje Box.
Z drugiej strony Box nie wymaga lifetimu i nie trzeba tak jak tutaj gwarantować że obiekt będzie żył dłużej niż struktura to spora zaleta, box sam zajmie się dealokacją we właściwym momencie. Ma też ownership obiektu co wydaje mi się że może być i plusem i minusem zależnie od przypadku, bo czasami możemy chcieć coś tylko pożyczyć na chwilę a nie oddawać.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

to najwyżej później zrobi się refaktor - fajnie gdybyśmy się zdecydowali na jeden sposób i tak robili dalej
możesz wybrać 🙂

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Raczej nie powinniśmy się skupiać na tym żeby wszędzie było to tak samo zrobione, po prostu trzeba się zastanowić czego potrzebujemy - czy wystarczy nam sama pożyczka (&'a dyn Trait) czy chcemy żeby struktura miała własność obiektu (Box).

Jak już mielibyśmy się na jedno decydować no to raczej Box bo dzięki niemu chociażby da się przechowywać różne implementacje jednego traita w kolekcji

Comment thread engine/src/object_storage/meva_object_storage.rs Outdated
@mikolajkarbowski mikolajkarbowski merged commit 7221611 into develop Sep 29, 2025
1 check 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