XL: Rename objectN to part.N (#2019)

Fixes #2015
master
Harshavardhana 9 years ago committed by GitHub
parent 5291db60c6
commit 4db2b03312
  1. 4
      docs/backend/fs/fs.json
  2. 2
      docs/backend/xl/uploads.json
  3. 16
      docs/backend/xl/xl.json
  4. 2
      fs-v1-multipart.go
  5. 10
      xl-v1-metadata_test.go
  6. 4
      xl-v1-multipart.go
  7. 6
      xl-v1-object.go

@ -1,5 +1,5 @@
{ {
"version": "1", "version": "1.0.0",
"format": "fs", "format": "fs",
"minio": { "minio": {
"release": "DEVELOPMENT.GOGET" "release": "DEVELOPMENT.GOGET"
@ -7,7 +7,7 @@
"parts": [ "parts": [
{ {
"number": 1, "number": 1,
"name": "object1", "name": "part.1",
"size": 29, "size": 29,
"eTag": "", "eTag": "",
}, },

@ -1,5 +1,5 @@
{ {
"version": "1", "version": "1.0.0",
"format": "xl", "format": "xl",
"uploadIds": [ "uploadIds": [
{ {

@ -4,19 +4,13 @@
"number": 1, "number": 1,
"size": 5242880, "size": 5242880,
"etag": "3565c6e741e69a007a5ac7db893a62b5", "etag": "3565c6e741e69a007a5ac7db893a62b5",
"name": "object1" "name": "part.1"
}, },
{ {
"number": 2, "number": 2,
"size": 5242880, "size": 5242880,
"etag": "d416712335c280ab1e39498552937764", "etag": "d416712335c280ab1e39498552937764",
"name": "object2" "name": "part.2"
},
{
"number": 3,
"size": 4338324,
"etag": "8a98c5c54d81c6c95ed9bdcaeb941aaf",
"name": "object3"
} }
], ],
"meta": { "meta": {
@ -36,12 +30,12 @@
"data": 5, "data": 5,
"checksum": [ "checksum": [
{ {
"name": "object1", "name": "part.1",
"algorithm": "blake2b", "algorithm": "blake2b",
"hash": "173c2cda7fb9e2798f91ba10135b65475fd2b97684355b328941d1c470a37549502672b2b4630c8268d5e5f79c8eb2fe433a25c6368f31d75b2c0504e3104c0e", "hash": "173c2cda7fb9e2798f91ba10135b65475fd2b97684355b328941d1c470a37549502672b2b4630c8268d5e5f79c8eb2fe433a25c6368f31d75b2c0504e3104c0e",
}, },
{ {
"name": "object2", "name": "part.2",
"algorithm": "blake2b", "algorithm": "blake2b",
"hash": "14f9ba0006b2db7cd171507e79032ad3a34eab7df02b6564c487614b6d1e6613343a4f56074aa3473ac9c3b26e00cbbeae937d478cca4cfb138e72838ebb0826", "hash": "14f9ba0006b2db7cd171507e79032ad3a34eab7df02b6564c487614b6d1e6613343a4f56074aa3473ac9c3b26e00cbbeae937d478cca4cfb138e72838ebb0826",
}, },
@ -53,5 +47,5 @@
"size": 14824084 "size": 14824084
}, },
"format": "xl", "format": "xl",
"version": "1" "version": "1.0.0"
} }

@ -488,7 +488,7 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload
return "", err return "", err
} }
tempObj := path.Join(tmpMetaPrefix, uploadID, "object1") tempObj := path.Join(tmpMetaPrefix, uploadID, "part.1")
// Allocate 128KiB of staging buffer. // Allocate 128KiB of staging buffer.
var buf = make([]byte, readSizeV1) var buf = make([]byte, readSizeV1)

@ -31,11 +31,11 @@ func TestXLMetaV1(t *testing.T) {
size int64 size int64
index int index int
}{ }{
{5, "object5", "etag5", fiveMB + 5, 3}, {5, "part.5", "etag5", fiveMB + 5, 3},
{4, "object4", "etag4", fiveMB + 4, 2}, {4, "part.4", "etag4", fiveMB + 4, 2},
{7, "object7", "etag7", fiveMB + 7, 4}, {7, "part.7", "etag7", fiveMB + 7, 4},
{2, "object2", "etag2", fiveMB + 2, 1}, {2, "part.2", "etag2", fiveMB + 2, 1},
{1, "object1", "etag1", fiveMB + 1, 0}, {1, "part.1", "etag1", fiveMB + 1, 0},
} }
// Create a XLMetaV1 structure to test on. // Create a XLMetaV1 structure to test on.

@ -334,7 +334,7 @@ func (xl xlObjects) putObjectPart(bucket string, object string, uploadID string,
// Pick one from the first valid metadata. // Pick one from the first valid metadata.
xlMeta := pickValidXLMeta(partsMetadata) xlMeta := pickValidXLMeta(partsMetadata)
partSuffix := fmt.Sprintf("object%d", partID) partSuffix := fmt.Sprintf("part.%d", partID)
tmpPartPath := path.Join(tmpMetaPrefix, uploadID, partSuffix) tmpPartPath := path.Join(tmpMetaPrefix, uploadID, partSuffix)
// Initialize md5 writer. // Initialize md5 writer.
@ -612,7 +612,7 @@ func (xl xlObjects) CompleteMultipartUpload(bucket string, object string, upload
Number: part.PartNumber, Number: part.PartNumber,
ETag: part.ETag, ETag: part.ETag,
Size: currentXLMeta.Parts[partIdx].Size, Size: currentXLMeta.Parts[partIdx].Size,
Name: fmt.Sprintf("object%d", part.PartNumber), Name: fmt.Sprintf("part.%d", part.PartNumber),
} }
} }

@ -304,7 +304,7 @@ func (xl xlObjects) PutObject(bucket string, object string, size int64, data io.
defer nsMutex.Unlock(bucket, object) defer nsMutex.Unlock(bucket, object)
uniqueID := getUUID() uniqueID := getUUID()
tempErasureObj := path.Join(tmpMetaPrefix, uniqueID, "object1") tempErasureObj := path.Join(tmpMetaPrefix, uniqueID, "part.1")
tempObj := path.Join(tmpMetaPrefix, uniqueID) tempObj := path.Join(tmpMetaPrefix, uniqueID)
// Initialize xl meta. // Initialize xl meta.
@ -342,7 +342,7 @@ func (xl xlObjects) PutObject(bucket string, object string, size int64, data io.
} }
// Erasure code and write across all disks. // Erasure code and write across all disks.
newEInfos, n, err := erasureCreateFile(onlineDisks, minioMetaBucket, tempErasureObj, "object1", teeReader, eInfos, xl.writeQuorum) newEInfos, n, err := erasureCreateFile(onlineDisks, minioMetaBucket, tempErasureObj, "part.1", teeReader, eInfos, xl.writeQuorum)
if err != nil { if err != nil {
return "", toObjectErr(err, minioMetaBucket, tempErasureObj) return "", toObjectErr(err, minioMetaBucket, tempErasureObj)
} }
@ -399,7 +399,7 @@ func (xl xlObjects) PutObject(bucket string, object string, size int64, data io.
xlMeta.Stat.ModTime = modTime xlMeta.Stat.ModTime = modTime
xlMeta.Stat.Version = higherVersion xlMeta.Stat.Version = higherVersion
// Add the final part. // Add the final part.
xlMeta.AddObjectPart(1, "object1", newMD5Hex, xlMeta.Stat.Size) xlMeta.AddObjectPart(1, "part.1", newMD5Hex, xlMeta.Stat.Size)
// Update `xl.json` content on each disks. // Update `xl.json` content on each disks.
for index := range partsMetadata { for index := range partsMetadata {

Loading…
Cancel
Save