mirror of
https://github.com/minio/minio.git
synced 2025-03-30 17:23:42 -04:00
Add object parity in listing V2M and listing versions M (#17238)
This commit is contained in:
parent
ecfb18b26a
commit
a30a55f3b1
@ -345,6 +345,13 @@ func (s *Metadata) MarshalXML(e *xxml.Encoder, start xxml.StartElement) error {
|
|||||||
return e.EncodeToken(start.End())
|
return e.EncodeToken(start.End())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ObjectInternalInfo contains some internal information about a given
|
||||||
|
// object, it will printed in listing calls with enabled metadata.
|
||||||
|
type ObjectInternalInfo struct {
|
||||||
|
K int // Data blocks
|
||||||
|
M int // Parity blocks
|
||||||
|
}
|
||||||
|
|
||||||
// Object container for object metadata
|
// Object container for object metadata
|
||||||
type Object struct {
|
type Object struct {
|
||||||
Key string
|
Key string
|
||||||
@ -361,6 +368,8 @@ type Object struct {
|
|||||||
// UserMetadata user-defined metadata
|
// UserMetadata user-defined metadata
|
||||||
UserMetadata *Metadata `xml:"UserMetadata,omitempty"`
|
UserMetadata *Metadata `xml:"UserMetadata,omitempty"`
|
||||||
UserTags string `xml:"UserTags,omitempty"`
|
UserTags string `xml:"UserTags,omitempty"`
|
||||||
|
|
||||||
|
Internal *ObjectInternalInfo `xml:"Internal,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CopyObjectResponse container returns ETag and LastModified of the successfully copied object
|
// CopyObjectResponse container returns ETag and LastModified of the successfully copied object
|
||||||
@ -552,6 +561,10 @@ func generateListVersionsResponse(bucket, prefix, marker, versionIDMarker, delim
|
|||||||
}
|
}
|
||||||
content.UserMetadata.Set(k, v)
|
content.UserMetadata.Set(k, v)
|
||||||
}
|
}
|
||||||
|
content.Internal = &ObjectInternalInfo{
|
||||||
|
K: object.DataBlocks,
|
||||||
|
M: object.ParityBlocks,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
content.Owner = owner
|
content.Owner = owner
|
||||||
content.VersionID = object.VersionID
|
content.VersionID = object.VersionID
|
||||||
@ -687,6 +700,10 @@ func generateListObjectsV2Response(bucket, prefix, token, nextToken, startAfter,
|
|||||||
}
|
}
|
||||||
content.UserMetadata.Set(k, v)
|
content.UserMetadata.Set(k, v)
|
||||||
}
|
}
|
||||||
|
content.Internal = &ObjectInternalInfo{
|
||||||
|
K: object.DataBlocks,
|
||||||
|
M: object.ParityBlocks,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contents = append(contents, content)
|
contents = append(contents, content)
|
||||||
|
@ -158,6 +158,8 @@ func (fi FileInfo) ToObjectInfo(bucket, object string, versioned bool) ObjectInf
|
|||||||
IsDir: HasSuffix(object, SlashSeparator),
|
IsDir: HasSuffix(object, SlashSeparator),
|
||||||
Bucket: bucket,
|
Bucket: bucket,
|
||||||
Name: object,
|
Name: object,
|
||||||
|
ParityBlocks: fi.Erasure.ParityBlocks,
|
||||||
|
DataBlocks: fi.Erasure.DataBlocks,
|
||||||
VersionID: versionID,
|
VersionID: versionID,
|
||||||
IsLatest: fi.IsLatest,
|
IsLatest: fi.IsLatest,
|
||||||
DeleteMarker: fi.Deleted,
|
DeleteMarker: fi.Deleted,
|
||||||
|
@ -196,6 +196,9 @@ type ObjectInfo struct {
|
|||||||
|
|
||||||
// Inlined
|
// Inlined
|
||||||
Inlined bool
|
Inlined bool
|
||||||
|
|
||||||
|
DataBlocks int
|
||||||
|
ParityBlocks int
|
||||||
}
|
}
|
||||||
|
|
||||||
// ArchiveInfo returns any saved zip archive meta information.
|
// ArchiveInfo returns any saved zip archive meta information.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user