Removing fsstorage

This commit is contained in:
Frederick F. Kautz IV
2014-12-15 16:13:41 +13:00
parent 62797cd6a7
commit 05baa6d9a2
9 changed files with 22 additions and 334 deletions

View File

@@ -26,7 +26,6 @@ import (
"github.com/gorilla/mux"
"github.com/minio-io/minio/pkgs/storage/encodedstorage"
"github.com/minio-io/minio/pkgs/storage/fsstorage"
"github.com/tchap/go-patricia/patricia"
)
@@ -243,24 +242,24 @@ func SimpleEncodedStorageDriver(bucket string, input chan ObjectRequest, config
}
}
func SimpleFileStorageDriver(bucket string, input chan ObjectRequest, config GatewayConfig) {
fileStorage, _ := fsstorage.NewStorage(config.DataDir, config.BlockSize)
for request := range input {
switch request.requestType {
case "GET":
objectPath := path.Join(bucket, request.path)
object, err := fileStorage.Get(objectPath)
if err != nil {
request.callback <- nil
} else {
request.callback <- object
}
case "PUT":
objectPath := path.Join(bucket, request.path)
fileStorage.Put(objectPath, bytes.NewBuffer(request.object))
request.callback <- nil
default:
request.callback <- errors.New("Unexpected message")
}
}
}
//func SimpleFileStorageDriver(bucket string, input chan ObjectRequest, config GatewayConfig) {
// fileStorage, _ := fsstorage.NewStorage(config.DataDir, config.BlockSize)
// for request := range input {
// switch request.requestType {
// case "GET":
// objectPath := path.Join(bucket, request.path)
// object, err := fileStorage.Get(objectPath)
// if err != nil {
// request.callback <- nil
// } else {
// request.callback <- object
// }
// case "PUT":
// objectPath := path.Join(bucket, request.path)
// fileStorage.Put(objectPath, bytes.NewBuffer(request.object))
// request.callback <- nil
// default:
// request.callback <- errors.New("Unexpected message")
// }
// }
//}

View File

@@ -116,11 +116,6 @@ func (s *GatewaySuite) TestInMemoryBucketOperations(c *C) {
StorageDriver: InMemoryStorageDriver,
requestBucketChan: make(chan BucketRequest),
},
GatewayConfig{
StorageDriver: SimpleFileStorageDriver,
requestBucketChan: make(chan BucketRequest),
DataDir: simpleFileStorageRootDir,
},
GatewayConfig{
StorageDriver: SimpleEncodedStorageDriver,
requestBucketChan: make(chan BucketRequest),