Make shard Enumerate use new blobserver.MergedEnumerated; not yet implemented.

Will need for replica target too.
This commit is contained in:
Brad Fitzpatrick 2011-05-21 18:19:37 -07:00
parent 941ac98281
commit 21797e2150
2 changed files with 33 additions and 8 deletions

View File

@ -0,0 +1,30 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package blobserver
import (
"os"
"camli/blobref"
)
// TODO: it'd be nice to make sources be []BlobEnumerator, but that
// makes callers more complex since assignable interfaces' slice forms
// aren't assignable.
func MergedEnumerated(dest chan<- blobref.SizedBlobRef, sources []Storage, after string, limit uint, waitSeconds int) os.Error {
return os.NewError("TODO: NOT IMPLEMENTED")
}

View File

@ -103,19 +103,14 @@ func (sto *shardStorage) Remove(blobs []*blobref.BlobRef) os.Error {
})
}
func (sto *shardStorage) Stat(dest chan<- blobref.SizedBlobRef,
blobs []*blobref.BlobRef,
waitSeconds int) os.Error {
func (sto *shardStorage) Stat(dest chan<- blobref.SizedBlobRef, blobs []*blobref.BlobRef, waitSeconds int) os.Error {
return sto.batchedShards(blobs, func(s blobserver.Storage, blobs []*blobref.BlobRef) os.Error {
return s.Stat(dest, blobs, waitSeconds)
})
}
func (sto *shardStorage) EnumerateBlobs(dest chan<- blobref.SizedBlobRef,
after string,
limit uint,
waitSeconds int) os.Error {
return os.NewError("shard: TODO: NOT IMPLEMENTED")
func (sto *shardStorage) EnumerateBlobs(dest chan<- blobref.SizedBlobRef, after string, limit uint, waitSeconds int) os.Error {
return blobserver.MergedEnumerated(dest, sto.shards, after, limit, waitSeconds)
}
func init() {