XL: Implement new ReadAll API for files which are read in single call. (#1974)

Add a unit test as well.
This commit is contained in:
Harshavardhana
2016-06-25 14:51:06 -07:00
committed by Anand Babu (AB) Periasamy
parent ed2fdd90b0
commit 42286cba70
11 changed files with 211 additions and 48 deletions
+10
View File
@@ -75,6 +75,16 @@ func (s *storageServer) ListDirHandler(arg *ListDirArgs, reply *[]string) error
return nil
}
// ReadAllHandler - read all handler is rpc wrapper to read all storage API.
func (s *storageServer) ReadAllHandler(arg *ReadFileArgs, reply *[]byte) error {
buf, err := s.storage.ReadAll(arg.Vol, arg.Path)
if err != nil {
return err
}
reply = &buf
return nil
}
// ReadFileHandler - read file handler is rpc wrapper to read file.
func (s *storageServer) ReadFileHandler(arg *ReadFileArgs, reply *int64) error {
n, err := s.storage.ReadFile(arg.Vol, arg.Path, arg.Offset, arg.Buffer)