projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
16328: Merge branch 'master' into 16328-keep-proxy-uses-config.yaml-to-find-keepstores
[arvados.git]
/
sdk
/
go
/
arvados
/
fs_base.go
diff --git
a/sdk/go/arvados/fs_base.go
b/sdk/go/arvados/fs_base.go
index f5916f9571d1743f215f97b866a0f871b7c7806d..d06aba3695adc37f3d74057de2568778bcd9f9c9 100644
(file)
--- a/
sdk/go/arvados/fs_base.go
+++ b/
sdk/go/arvados/fs_base.go
@@
-58,6
+58,9
@@
type FileSystem interface {
// while locking multiple inodes.
locker() sync.Locker
// while locking multiple inodes.
locker() sync.Locker
+ // throttle for limiting concurrent background writers
+ throttle() *throttle
+
// create a new node with nil parent.
newNode(name string, perm os.FileMode, modTime time.Time) (node inode, err error)
// create a new node with nil parent.
newNode(name string, perm os.FileMode, modTime time.Time) (node inode, err error)
@@
-95,8
+98,10
@@
type FileSystem interface {
// for all writes to finish before returning. If shortBlocks
// is true, flush everything; otherwise, if there's less than
// a full block of buffered data at the end of a stream, leave
// for all writes to finish before returning. If shortBlocks
// is true, flush everything; otherwise, if there's less than
// a full block of buffered data at the end of a stream, leave
- // it buffered in memory in case more data can be appended.
- Flush(shortBlocks bool) error
+ // it buffered in memory in case more data can be appended. If
+ // path is "", flush all dirs/streams; otherwise, flush only
+ // the specified dir/stream.
+ Flush(path string, shortBlocks bool) error
}
type inode interface {
}
type inode interface {
@@
-298,12
+303,17
@@
type fileSystem struct {
root inode
fsBackend
mutex sync.Mutex
root inode
fsBackend
mutex sync.Mutex
+ thr *throttle
}
func (fs *fileSystem) rootnode() inode {
return fs.root
}
}
func (fs *fileSystem) rootnode() inode {
return fs.root
}
+func (fs *fileSystem) throttle() *throttle {
+ return fs.thr
+}
+
func (fs *fileSystem) locker() sync.Locker {
return &fs.mutex
}
func (fs *fileSystem) locker() sync.Locker {
return &fs.mutex
}
@@
-570,7
+580,7
@@
func (fs *fileSystem) Sync() error {
return ErrInvalidOperation
}
return ErrInvalidOperation
}
-func (fs *fileSystem) Flush(bool) error {
+func (fs *fileSystem) Flush(
string,
bool) error {
log.Printf("TODO: flush fileSystem")
return ErrInvalidOperation
}
log.Printf("TODO: flush fileSystem")
return ErrInvalidOperation
}