mirror of
https://github.com/minio/minio.git
synced 2024-12-27 15:45:55 -05:00
c829e3a13b
With this change, MinIO's ILM supports transitioning objects to a remote tier. This change includes support for Azure Blob Storage, AWS S3 compatible object storage incl. MinIO and Google Cloud Storage as remote tier storage backends. Some new additions include: - Admin APIs remote tier configuration management - Simple journal to track remote objects to be 'collected' This is used by object API handlers which 'mutate' object versions by overwriting/replacing content (Put/CopyObject) or removing the version itself (e.g DeleteObjectVersion). - Rework of previous ILM transition to fit the new model In the new model, a storage class (a.k.a remote tier) is defined by the 'remote' object storage type (one of s3, azure, GCS), bucket name and a prefix. * Fixed bugs, review comments, and more unit-tests - Leverage inline small object feature - Migrate legacy objects to the latest object format before transitioning - Fix restore to particular version if specified - Extend SharedDataDirCount to handle transitioned and restored objects - Restore-object should accept version-id for version-suspended bucket (#12091) - Check if remote tier creds have sufficient permissions - Bonus minor fixes to existing error messages Co-authored-by: Poorna Krishnamoorthy <poorna@minio.io> Co-authored-by: Krishna Srinivas <krishna@minio.io> Signed-off-by: Harshavardhana <harsha@minio.io>
236 lines
5.5 KiB
Go
236 lines
5.5 KiB
Go
package madmin
|
|
|
|
// Code generated by github.com/tinylib/msgp DO NOT EDIT.
|
|
|
|
import (
|
|
"github.com/tinylib/msgp/msgp"
|
|
)
|
|
|
|
// DecodeMsg implements msgp.Decodable
|
|
func (z *TierGCS) DecodeMsg(dc *msgp.Reader) (err error) {
|
|
var field []byte
|
|
_ = field
|
|
var zb0001 uint32
|
|
zb0001, err = dc.ReadMapHeader()
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
for zb0001 > 0 {
|
|
zb0001--
|
|
field, err = dc.ReadMapKeyPtr()
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
switch msgp.UnsafeString(field) {
|
|
case "Endpoint":
|
|
z.Endpoint, err = dc.ReadString()
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Endpoint")
|
|
return
|
|
}
|
|
case "Creds":
|
|
z.Creds, err = dc.ReadString()
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Creds")
|
|
return
|
|
}
|
|
case "Bucket":
|
|
z.Bucket, err = dc.ReadString()
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Bucket")
|
|
return
|
|
}
|
|
case "Prefix":
|
|
z.Prefix, err = dc.ReadString()
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Prefix")
|
|
return
|
|
}
|
|
case "Region":
|
|
z.Region, err = dc.ReadString()
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Region")
|
|
return
|
|
}
|
|
case "StorageClass":
|
|
z.StorageClass, err = dc.ReadString()
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "StorageClass")
|
|
return
|
|
}
|
|
default:
|
|
err = dc.Skip()
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
// EncodeMsg implements msgp.Encodable
|
|
func (z *TierGCS) EncodeMsg(en *msgp.Writer) (err error) {
|
|
// map header, size 6
|
|
// write "Endpoint"
|
|
err = en.Append(0x86, 0xa8, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = en.WriteString(z.Endpoint)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Endpoint")
|
|
return
|
|
}
|
|
// write "Creds"
|
|
err = en.Append(0xa5, 0x43, 0x72, 0x65, 0x64, 0x73)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = en.WriteString(z.Creds)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Creds")
|
|
return
|
|
}
|
|
// write "Bucket"
|
|
err = en.Append(0xa6, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = en.WriteString(z.Bucket)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Bucket")
|
|
return
|
|
}
|
|
// write "Prefix"
|
|
err = en.Append(0xa6, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = en.WriteString(z.Prefix)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Prefix")
|
|
return
|
|
}
|
|
// write "Region"
|
|
err = en.Append(0xa6, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = en.WriteString(z.Region)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Region")
|
|
return
|
|
}
|
|
// write "StorageClass"
|
|
err = en.Append(0xac, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = en.WriteString(z.StorageClass)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "StorageClass")
|
|
return
|
|
}
|
|
return
|
|
}
|
|
|
|
// MarshalMsg implements msgp.Marshaler
|
|
func (z *TierGCS) MarshalMsg(b []byte) (o []byte, err error) {
|
|
o = msgp.Require(b, z.Msgsize())
|
|
// map header, size 6
|
|
// string "Endpoint"
|
|
o = append(o, 0x86, 0xa8, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74)
|
|
o = msgp.AppendString(o, z.Endpoint)
|
|
// string "Creds"
|
|
o = append(o, 0xa5, 0x43, 0x72, 0x65, 0x64, 0x73)
|
|
o = msgp.AppendString(o, z.Creds)
|
|
// string "Bucket"
|
|
o = append(o, 0xa6, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74)
|
|
o = msgp.AppendString(o, z.Bucket)
|
|
// string "Prefix"
|
|
o = append(o, 0xa6, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78)
|
|
o = msgp.AppendString(o, z.Prefix)
|
|
// string "Region"
|
|
o = append(o, 0xa6, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e)
|
|
o = msgp.AppendString(o, z.Region)
|
|
// string "StorageClass"
|
|
o = append(o, 0xac, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73)
|
|
o = msgp.AppendString(o, z.StorageClass)
|
|
return
|
|
}
|
|
|
|
// UnmarshalMsg implements msgp.Unmarshaler
|
|
func (z *TierGCS) UnmarshalMsg(bts []byte) (o []byte, err error) {
|
|
var field []byte
|
|
_ = field
|
|
var zb0001 uint32
|
|
zb0001, bts, err = msgp.ReadMapHeaderBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
for zb0001 > 0 {
|
|
zb0001--
|
|
field, bts, err = msgp.ReadMapKeyZC(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
switch msgp.UnsafeString(field) {
|
|
case "Endpoint":
|
|
z.Endpoint, bts, err = msgp.ReadStringBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Endpoint")
|
|
return
|
|
}
|
|
case "Creds":
|
|
z.Creds, bts, err = msgp.ReadStringBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Creds")
|
|
return
|
|
}
|
|
case "Bucket":
|
|
z.Bucket, bts, err = msgp.ReadStringBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Bucket")
|
|
return
|
|
}
|
|
case "Prefix":
|
|
z.Prefix, bts, err = msgp.ReadStringBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Prefix")
|
|
return
|
|
}
|
|
case "Region":
|
|
z.Region, bts, err = msgp.ReadStringBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Region")
|
|
return
|
|
}
|
|
case "StorageClass":
|
|
z.StorageClass, bts, err = msgp.ReadStringBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "StorageClass")
|
|
return
|
|
}
|
|
default:
|
|
bts, err = msgp.Skip(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
}
|
|
}
|
|
o = bts
|
|
return
|
|
}
|
|
|
|
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
|
|
func (z *TierGCS) Msgsize() (s int) {
|
|
s = 1 + 9 + msgp.StringPrefixSize + len(z.Endpoint) + 6 + msgp.StringPrefixSize + len(z.Creds) + 7 + msgp.StringPrefixSize + len(z.Bucket) + 7 + msgp.StringPrefixSize + len(z.Prefix) + 7 + msgp.StringPrefixSize + len(z.Region) + 13 + msgp.StringPrefixSize + len(z.StorageClass)
|
|
return
|
|
}
|