Add context to the object-interface methods.

Make necessary changes to xl fs azure sia
This commit is contained in:
Krishna Srinivas
2018-03-14 12:01:47 -07:00
committed by kannappanr
parent 9083bc152e
commit e452377b24
58 changed files with 844 additions and 610 deletions

View File

@@ -44,7 +44,7 @@ func testListObjects(obj ObjectLayer, instanceType string, t TestErrHandler) {
"empty-bucket",
}
for _, bucket := range testBuckets {
err := obj.MakeBucketWithLocation(bucket, "")
err := obj.MakeBucketWithLocation(nil, bucket, "")
if err != nil {
t.Fatalf("%s : %s", instanceType, err.Error())
}
@@ -68,7 +68,7 @@ func testListObjects(obj ObjectLayer, instanceType string, t TestErrHandler) {
}
for _, object := range testObjects {
md5Bytes := md5.Sum([]byte(object.content))
_, err = obj.PutObject(testBuckets[0], object.name, mustGetHashReader(t, bytes.NewBufferString(object.content),
_, err = obj.PutObject(nil, testBuckets[0], object.name, mustGetHashReader(t, bytes.NewBufferString(object.content),
int64(len(object.content)), hex.EncodeToString(md5Bytes[:]), ""), object.meta)
if err != nil {
t.Fatalf("%s : %s", instanceType, err.Error())
@@ -524,7 +524,7 @@ func testListObjects(obj ObjectLayer, instanceType string, t TestErrHandler) {
}
for i, testCase := range testCases {
result, err := obj.ListObjects(testCase.bucketName, testCase.prefix, testCase.marker, testCase.delimeter, int(testCase.maxKeys))
result, err := obj.ListObjects(nil, testCase.bucketName, testCase.prefix, testCase.marker, testCase.delimeter, int(testCase.maxKeys))
if err != nil && testCase.shouldPass {
t.Errorf("Test %d: %s: Expected to pass, but failed with: <ERROR> %s", i+1, instanceType, err.Error())
}
@@ -565,7 +565,7 @@ func testListObjects(obj ObjectLayer, instanceType string, t TestErrHandler) {
}
// Take ListObject treeWalk go-routine to completion, if available in the treewalk pool.
if result.IsTruncated {
_, err = obj.ListObjects(testCase.bucketName, testCase.prefix, result.NextMarker, testCase.delimeter, 1000)
_, err = obj.ListObjects(nil, testCase.bucketName, testCase.prefix, result.NextMarker, testCase.delimeter, 1000)
if err != nil {
t.Fatal(err)
}
@@ -603,7 +603,7 @@ func BenchmarkListObjects(b *testing.B) {
bucket := "ls-benchmark-bucket"
// Create a bucket.
err = obj.MakeBucketWithLocation(bucket, "")
err = obj.MakeBucketWithLocation(nil, bucket, "")
if err != nil {
b.Fatal(err)
}
@@ -611,7 +611,7 @@ func BenchmarkListObjects(b *testing.B) {
// Insert objects to be listed and benchmarked later.
for i := 0; i < 20000; i++ {
key := "obj" + strconv.Itoa(i)
_, err = obj.PutObject(bucket, key, mustGetHashReader(b, bytes.NewBufferString(key), int64(len(key)), "", ""), nil)
_, err = obj.PutObject(nil, bucket, key, mustGetHashReader(b, bytes.NewBufferString(key), int64(len(key)), "", ""), nil)
if err != nil {
b.Fatal(err)
}
@@ -621,7 +621,7 @@ func BenchmarkListObjects(b *testing.B) {
// List the buckets over and over and over.
for i := 0; i < b.N; i++ {
_, err = obj.ListObjects(bucket, "", "obj9000", "", -1)
_, err = obj.ListObjects(nil, bucket, "", "obj9000", "", -1)
if err != nil {
b.Fatal(err)
}