9068: Move buffer allocation from volumes to GetBlockHandler.
authorTom Clegg <tom@curoverse.com>
Fri, 29 Apr 2016 16:55:24 +0000 (12:55 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 4 May 2016 15:10:22 +0000 (11:10 -0400)
commit959f37498c5f1610612452ab227ba4680b30e8e6
tree51b44d6ac54e00e84e94f82a17d5a04ca61aafab
parentfba69e99ccafb4c956e688e8fef3d2f71100ed95
9068: Move buffer allocation from volumes to GetBlockHandler.

This makes the Volume interface more idiomatic: Get() accepts a buffer
to read into, and returns a number of bytes read, much like the Read()
method of an io.Reader.

It also makes it possible for GetBlockHandler to notice, while waiting
for a buffer, that the client has disconnected: In this case, it
releases the network socket and never asks any volumes to do any work.
16 files changed:
services/keepstore/azure_blob_volume.go
services/keepstore/azure_blob_volume_test.go
services/keepstore/handler_test.go
services/keepstore/handlers.go
services/keepstore/handlers_with_generic_volume_test.go
services/keepstore/keepstore.go
services/keepstore/keepstore_test.go
services/keepstore/logging_router.go
services/keepstore/logging_router_test.go [new file with mode: 0644]
services/keepstore/s3_volume.go
services/keepstore/trash_worker_test.go
services/keepstore/volume.go
services/keepstore/volume_generic_test.go
services/keepstore/volume_test.go
services/keepstore/volume_unix.go
services/keepstore/volume_unix_test.go