-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add blobs in manifest and fix bugs (#36)
Signed-off-by: sunby <[email protected]>
- Loading branch information
Showing
10 changed files
with
804 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "blob.h" | ||
#include <memory> | ||
#include "proto/manifest.pb.h" | ||
|
||
namespace milvus_storage { | ||
|
||
std::unique_ptr<manifest_proto::Blob> Blob::ToProtobuf() const { | ||
auto blob = std::make_unique<manifest_proto::Blob>(); | ||
blob->set_name(name); | ||
blob->set_size(size); | ||
blob->set_file(file); | ||
return blob; | ||
} | ||
|
||
Blob Blob::FromProtobuf(const manifest_proto::Blob blob) { | ||
Blob ret; | ||
ret.name = blob.name(); | ||
ret.size = blob.size(); | ||
ret.file = blob.file(); | ||
return ret; | ||
} | ||
|
||
} // namespace milvus_storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
#include "proto/manifest.pb.h" | ||
#include "common/result.h" | ||
|
||
namespace milvus_storage { | ||
struct Blob { | ||
std::string name; | ||
int64_t size; | ||
std::string file; | ||
|
||
[[nodiscard]] std::unique_ptr<manifest_proto::Blob> ToProtobuf() const; | ||
static Blob FromProtobuf(const manifest_proto::Blob blob); | ||
}; | ||
|
||
using BlobVector = std::vector<Blob>; | ||
} // namespace milvus_storage |
Oops, something went wrong.