mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 08:36:54 +00:00
refactor(filemeta): FileInfo data use Bytes
This commit is contained in:
@@ -168,13 +168,13 @@ pub struct FileInfo {
|
||||
pub mark_deleted: bool,
|
||||
// ReplicationState - Internal replication state to be passed back in ObjectInfo
|
||||
// pub replication_state: Option<ReplicationState>, // TODO: implement ReplicationState
|
||||
pub data: Option<Vec<u8>>,
|
||||
pub data: Option<Bytes>,
|
||||
pub num_versions: usize,
|
||||
pub successor_mod_time: Option<OffsetDateTime>,
|
||||
pub fresh: bool,
|
||||
pub idx: usize,
|
||||
// Combined checksum when object was uploaded
|
||||
pub checksum: Option<Vec<u8>>,
|
||||
pub checksum: Option<Bytes>,
|
||||
pub versioned: bool,
|
||||
}
|
||||
|
||||
|
||||
@@ -419,7 +419,7 @@ impl FileMeta {
|
||||
|
||||
if let Some(ref data) = fi.data {
|
||||
let key = vid.unwrap_or_default().to_string();
|
||||
self.data.replace(&key, data.clone())?;
|
||||
self.data.replace(&key, data.to_vec())?;
|
||||
}
|
||||
|
||||
let version = FileMetaVersion::from(fi);
|
||||
@@ -543,7 +543,10 @@ impl FileMeta {
|
||||
}
|
||||
|
||||
if read_data {
|
||||
fi.data = self.data.find(fi.version_id.unwrap_or_default().to_string().as_str())?;
|
||||
fi.data = self
|
||||
.data
|
||||
.find(fi.version_id.unwrap_or_default().to_string().as_str())?
|
||||
.map(bytes::Bytes::from);
|
||||
}
|
||||
|
||||
fi.num_versions = self.versions.len();
|
||||
|
||||
Reference in New Issue
Block a user