8554: Dedup Get() checks, add comments, fix up regexp.
[arvados.git] / services / keepstore / azure_blob_volume.go
index 0071567afabed21084abce843038929a03afbaf8..687c2fb36b7526bbbe498b86fd3c154d07ce9bd4 100644 (file)
@@ -43,6 +43,10 @@ type azureVolumeAdder struct {
 }
 
 func (s *azureVolumeAdder) Set(containerName string) error {
+       if trashLifetime != 0 {
+               return ErrNotImplemented
+       }
+
        if containerName == "" {
                return errors.New("no container name given")
        }
@@ -316,6 +320,11 @@ func (v *AzureBlobVolume) Trash(loc string) error {
        if v.readonly {
                return MethodDisabledError
        }
+
+       if trashLifetime != 0 {
+               return ErrNotImplemented
+       }
+
        // Ideally we would use If-Unmodified-Since, but that
        // particular condition seems to be ignored by Azure. Instead,
        // we get the Etag before checking Mtime, and use If-Match to
@@ -338,7 +347,7 @@ func (v *AzureBlobVolume) Trash(loc string) error {
 // Untrash a Keep block.
 // TBD
 func (v *AzureBlobVolume) Untrash(loc string) error {
-       return nil
+       return ErrNotImplemented
 }
 
 // Status returns a VolumeStatus struct with placeholder data.
@@ -386,3 +395,9 @@ var keepBlockRegexp = regexp.MustCompile(`^[0-9a-f]{32}$`)
 func (v *AzureBlobVolume) isKeepBlock(s string) bool {
        return keepBlockRegexp.MatchString(s)
 }
+
+// EmptyTrash looks for trashed blocks that exceeded trashLifetime
+// and deletes them from the volume.
+// TBD
+func (v *AzureBlobVolume) EmptyTrash() {
+}