Replace StorageLayer.CurrentSize interface call with Stat
To support single-flight Size and ModTime queries against backend storage file, we are replacing the CurrentSize call with a Stat call. A FileInfo interface is provided for backends to provide a type, with a default implementation called FileInfoInternal, for use by driver implementations. More work needs to follow this change to update all the driver implementations.
This commit is contained in:
@@ -54,10 +54,9 @@ type StorageDriver interface {
|
||||
// The offset must be no larger than the CurrentSize for this path.
|
||||
WriteStream(path string, offset, size int64, readCloser io.ReadCloser) error
|
||||
|
||||
// CurrentSize retrieves the curernt size in bytes of the object at the
|
||||
// given path.
|
||||
// It should be safe to read or write anywhere up to this point.
|
||||
CurrentSize(path string) (uint64, error)
|
||||
// Stat retrieves the FileInfo for the given path, including the current
|
||||
// size in bytes and the creation time.
|
||||
Stat(path string) (FileInfo, error)
|
||||
|
||||
// List returns a list of the objects that are direct descendants of the
|
||||
//given path.
|
||||
|
Reference in New Issue
Block a user