8099: 7263: Merge branch 'hgi/7263-even-better-busy-behavior' of github.com:wtsi...
[arvados.git] / services / keepstore / volume_unix.go
index 910cc25d613cb7690f944b418aebf5c205c7aced..0dd1d82a98ca4b9f14c79d8b96e90f10faf4311f 100644 (file)
@@ -23,6 +23,9 @@ type unixVolumeAdder struct {
 }
 
 func (vs *unixVolumeAdder) Set(value string) error {
+       if trashLifetime != 0 {
+               return ErrNotImplemented
+       }
        if dirs := strings.Split(value, ","); len(dirs) > 1 {
                log.Print("DEPRECATED: using comma-separated volume list.")
                for _, dir := range dirs {
@@ -363,7 +366,7 @@ func (v *UnixVolume) IndexTo(prefix string, w io.Writer) error {
 }
 
 // Delete deletes the block data from the unix storage
-func (v *UnixVolume) Delete(loc string) error {
+func (v *UnixVolume) Trash(loc string) error {
        // Touch() must be called before calling Write() on a block.  Touch()
        // also uses lockfile().  This avoids a race condition between Write()
        // and Delete() because either (a) the file will be deleted and Touch()
@@ -375,6 +378,9 @@ func (v *UnixVolume) Delete(loc string) error {
        if v.readonly {
                return MethodDisabledError
        }
+       if trashLifetime != 0 {
+               return ErrNotImplemented
+       }
        if v.locker != nil {
                v.locker.Lock()
                defer v.locker.Unlock()
@@ -405,6 +411,12 @@ func (v *UnixVolume) Delete(loc string) error {
        return os.Remove(p)
 }
 
+// Untrash moves block from trash back into store
+// TBD
+func (v *UnixVolume) Untrash(loc string) error {
+       return ErrNotImplemented
+}
+
 // blockDir returns the fully qualified directory name for the directory
 // where loc is (or would be) stored on this volume.
 func (v *UnixVolume) blockDir(loc string) string {