xl/fs: Split object layer into interface. (#1415)

This commit is contained in:
Harshavardhana
2016-04-29 14:24:10 -07:00
committed by Anand Babu (AB) Periasamy
parent 4d1b3d5e9a
commit 4e34e03dd4
61 changed files with 1815 additions and 1037 deletions

View File

@@ -29,12 +29,11 @@ var _ = Suite(&MySuite{})
func (s *MySuite) TestFSAPISuite(c *C) {
var storageList []string
create := func() objectAPI {
create := func() ObjectLayer {
path, err := ioutil.TempDir(os.TempDir(), "minio-")
c.Check(err, IsNil)
storageAPI, err := newStorageAPI(path)
objAPI, err := newFSObjects(path)
c.Check(err, IsNil)
objAPI := newObjectLayer(storageAPI)
storageList = append(storageList, path)
return objAPI
}
@@ -48,7 +47,7 @@ func (s *MySuite) TestXLAPISuite(c *C) {
// Initialize name space lock.
initNSLock()
create := func() objectAPI {
create := func() ObjectLayer {
var nDisks = 16 // Maximum disks.
var erasureDisks []string
for i := 0; i < nDisks; i++ {
@@ -56,10 +55,8 @@ func (s *MySuite) TestXLAPISuite(c *C) {
c.Check(err, IsNil)
erasureDisks = append(erasureDisks, path)
}
storageList = append(storageList, erasureDisks...)
storageAPI, err := newStorageAPI(erasureDisks...)
objAPI, err := newXLObjects(erasureDisks...)
c.Check(err, IsNil)
objAPI := newObjectLayer(storageAPI)
return objAPI
}
APITestSuite(c, create)